您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

利用浏览器缓存,如何在apache或.htaccess上使用?

利用浏览器缓存,如何在apache或.htaccess上使用?

几天前我在做同样的事情。将此添加到我的.htaccess文件中:

ExpiresActive On
ExpiresByType image/gif A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/png A2592000
ExpiresByType image/x-icon A2592000
ExpiresByType text/css A86400
ExpiresByType text/javascript A86400
ExpiresByType application/x-shockwave-flash A2592000
#
<FilesMatch "\.(gif¦jpe?g¦png¦ico¦css¦js¦swf)$">
Header set Cache-Control "public"
</FilesMatch>

现在,当我运行google speed page时,利用浏览器缓存不再是重中之重。

希望这可以帮助。

Access 2022/1/1 18:14:05 有603人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶