apache响应报⽂头部设置转载:
下载apacheApache⾥配置 mod_expires 和 mod_headers 以⽀持CACHE
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 days"
ExpiresByType text/html "access plus 1 weeks"
ExpiresByType image/gif "access plus 2 months"
ExpiresByType image/jpeg "access plus 2 months"
ExpiresByType application/x-shockwave-flash "access plus 2 months"
ExpiresByType application/x-javascript "access plus 2 months"
</IfModule>
<IfModule mod_headers.c>
# YEAR
<FilesMatch "\.(flv|gif|ico|jpeg)$">
Header set Cache-Control "max-age=2592000"
</FilesMatch>
# WEEK
<FilesMatch "\.(pdf|swf|js|css)$">
Header set Cache-Control "max-age=604800"
</FilesMatch>
# DAY
<FilesMatch "\.(htm|html|shtml)$">
Header set Cache-Control "max-age=604800"
</FilesMatch>
</IfModule>

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。