我正在尝试在我的网站上的 images/js/css ext.. 上设置到期日期,因为我在使用Page Speed的工具中看到它将有助于提高性能:
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>
我需要打开任何东西还是有办法让它工作?