现在的位置: 首页 > 综合 > 正文

Apache htaccess 设置 设置expires和max-age缓存 的兼容写法

2017年01月18日 ⁄ 综合 ⁄ 共 413字 ⁄ 字号 评论关闭

htaccess文件内容:

<pre name="code" class="plain"><IfModule mod_headers.c>
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Cache-Control "max-age=604800, public"
</FilesMatch>
<FilesMatch "\.(xml|txt)$">
Header set Cache-Control "max-age=18000, public, must-revalidate"
</FilesMatch>
<FilesMatch "\.(html|htm|php|shtml)$">
Header set Cache-Control "max-age=3600, must-revalidate"
</FilesMatch>
</IfModule>

by default7#zbphp.com

抱歉!评论已关闭.