关键字
文章内容
加速访问速度,开启页面缓存
 
 
修改时间:[2012/06/06 01:40]    阅读次数:[1623]    发表者:[起缘]
 

很简单的,把下面代码添加到网站的.htaccess文件里就行了

#START Expire Header
 ExpiresActive on //开启缓存
 ExpiresByType text/html "access 1 days"//html文件缓存一天
 ExpiresByType text/plain "access 1 days"//纯文本内容缓存一天
 ExpiresByType text/css "access 7 days"//css文件缓存一周
 ExpiresByType application/javascript "access 7 days"//JS文件缓存一周
 ExpiresByType image/jpeg "access 1 month"//jpeg图片缓存一个月
 ExpiresByType image/x-icon "access 1 month"//icon缓存一个月
 ExpiresByType image/gif "access 1 month"//gif图片缓存一个月
 ExpiresByType image/png "access 1 month"//png图片缓存一个月
 ExpiresByType image/ico "access 1 month"//ico缓存一个月
 ExpiresByType application/pdf "access 1 month"//pdf文件缓存一个月
 ExpiresByType application/x-shockwave-flash "access 1 month"//flash缓存一个月
 ExpiresDefault "access 1 month"// 默认(其他可缓存的资源)缓存一个月
#END Expire Header
现在试试,第2次开启网页速度是不是快多了。。。