我已经尝试获取杠杆浏览器缓存已有一段时间了,但我不知道可能是什么问题。我尝试了几种方法来激活它,但没有任何效果...
该站点在Namecheap主机上运行。我已经联系了支持人员并询问mod_expires模块是否处于活动状态,并且根据客户支持,它是...
这是我一直在使用的代码:
# START --- Browser Cache Control
# Turn on Expires and set default to 0
ExpiresActive On
ExpiresDefault A0
# Set up caching on media files for 1 year (forever?)
<FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$">
ExpiresDefault A29030400
Header append Cache-Control "public"
</FilesMatch>
# Set up caching on media files for 1 week
<FilesMatch "\.(gif|jpg|jpeg|png|swf)$">
ExpiresDefault A604800
Header append Cache-Control "public"
</FilesMatch>
# Set up 2 Hour caching on commonly updated files
<FilesMatch "\.(xml|txt|html|js|css)$">
ExpiresDefault A7200
Header append Cache-Control "proxy-revalidate"
</FilesMatch> …Run Code Online (Sandbox Code Playgroud)