apache 页面缓存机制,图片 缓存 (mod_expires)

来源:互联网 发布:淘宝浏览单佣金3 3 3 编辑:程序博客网 时间:2024/06/05 18:09

#LoadModule expires_module modules/mod_expires.so (去掉#号)


我把配置信息写到 .htaccess文件中

<IfModule mod_expires.c>

ExpiresActive On

ExpiresByType text/html A1000

# GIF有效期为1个月

ExpiresByType image/gif A2592000

# HTML文档的有效期是最后修改时刻后的一星期

ExpiresByType text/html M604800

#以下的含义类似

ExpiresByType text/css "now plus 2 months"

ExpiresByType text/js "now plus 2 days"

ExpiresByType image/jpeg "access plus 2 months"

ExpiresByType image/bmp "access plus 2 months"

ExpiresByType image/x-icon "access plus 2 months"

ExpiresByType image/png "access plus 2 months"

</IfModule>



如图



0 0
原创粉丝点击