https://static.iklfy.com/attach/2012/06/18/1328872193_5353f7f6.png

PHP版网站缓存加快打开速度!

说明:
1,在服务器缓存了压缩过的文件,再次访问减少再压缩时间,降低CPU占用率。
2,通过设置客户端文件缓存时间,降低再次请求次数,可降低85%以上。
3,图片因为已经是压缩格式,只是设置客户端缓存时间,不做压缩处理。
使用方法:
1,服务器必须支持gzip,Rewrite功能。
2,在.htacess文件的“RewriteBase /”下面一行添加下面的代码,见图
RewriteRule (.*.css$|.*.js$|.*.jpg$|.*.gif$|.*.png$) gzip.php?$1 [L>
3,上传gzip.php到根目录
4,在根目录建cache文件夹,保证可读写。
https://static.iklfy.com/static/images/index/6.jpg

robots 属性值 -- 定义网页搜索引擎索引方式

* robots用于定义网页搜索引擎索引方式
* robots出现在name属性中,使用content属性定义网页搜索引擎索引方式
* 通过使用meta的robots属性值可以为没有文件上传权限的用户提供/robots.txt文件的所有功能
* 如果网页没有提供robots,搜索引擎认为网页的robots属性为all(index,follow);
<meta name="robots" content="noindex" />

定义了此网页不被搜索引擎索引进数据库,但搜索引擎可以通过此网页的链接继续索引其它网页
https://static.iklfy.com/static/images/index/9.jpg

mysql查询替换语句

UPDATE `table_name` SET `field_name` = replace (`field_name`,'from_str','to_str') WHERE `field_name` LIKE '%from_str%'

说明:
table_name —— 表的名字
field_name —— 字段名
from_str —— 需要替换的字符串
to_str —— 替换成的字符串
下面是今天运行的两句SQL批量替换语句,如果用到的可以参考下!
 UPDATE boblog_blogs SET content = replace (content,'[mycode=xml]','[mycode=html]');

查询表 boblog_blogs 将 content 字段中的字符 [mycode=xml> 替换成 [mycode=html>
 UPDATE boblog_blogs SET content = replace (content,'[//mycode]','[/mycode]');

查询表 boblog_blogs 将 content 字段中的字符 [//mycode> 替换成 [/mycode>
UPDATE boblog_blogs SET htmlstat=0 where htmlstat=1

查询表 boblog_blogs 将 htmlstat 字段中的值 0 替换成 1