我如何判断 Leverage 浏览器缓存已打开?
我正在尝试在我的网站上的 images/js/css ext.. 上设置到期日期,因为我在我正在使用的工具中看到 页面速度 它将有助于性能:
The following cacheable resources have a short freshness lifetime. Specify an expiration at least one week in the future for the following resources:
http://somesite.com/images/chat/footer_btn_chat_on.png (expiration not specified)
http://somesite.com/images/footer.jpg (expiration not specified)
http://somesite.localhost/inc/cache/all.js (expiration not specified)
所以我将其添加到 htaccess 并刷新页面,但仍然是(未指定到期时间):
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/html "access plus 2 days"
ExpiresByType image/gif "access plus 60 days"
ExpiresByType image/jpg "access plus 60 days"
ExpiresByType image/png "access plus 60 days"
ExpiresByType application/x-javascript "access plus 60 days"
ExpiresByType text/css "access plus 60 days"
ExpiresByType image/x-icon "access plus 360 days"
</IfModule>
我需要打开任何东西吗?有办法让它发挥作用吗?
I am trying to set the expiring date on the images/js/css ext.. on my site because i see in a tool that I am using Page Speed that it will help performance:
The following cacheable resources have a short freshness lifetime. Specify an expiration at least one week in the future for the following resources:
http://somesite.com/images/chat/footer_btn_chat_on.png (expiration not specified)
http://somesite.com/images/footer.jpg (expiration not specified)
http://somesite.localhost/inc/cache/all.js (expiration not specified)
So I added this to the htaccess and refreshed the page and still the (expiration not specified):
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/html "access plus 2 days"
ExpiresByType image/gif "access plus 60 days"
ExpiresByType image/jpg "access plus 60 days"
ExpiresByType image/png "access plus 60 days"
ExpiresByType application/x-javascript "access plus 60 days"
ExpiresByType text/css "access plus 60 days"
ExpiresByType image/x-icon "access plus 360 days"
</IfModule>
Do I need to turn anything on or is there a way to get this to work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论