【发布时间】:2016-11-07 16:48:08
【问题描述】:
我的 .htaccess 文件中有以下代码:
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
</IfModule>
这意味着jpg 和jpeg 图像的缓存到期日期应为 1 年。 Chrome 的 DevTools 控制台中的响应标头反映了这一点。
content-type:image/jpeg
date:Mon, 07 Nov 2016 04:05:46 GMT
expires:Tue, 07 Nov 2017 04:05:46 GMT
last-modified:Sun, 06 Nov 2016 18:40:41 GMT
但是,在 PageSpeed 洞察力中,建议显示缓存仅在 5 小时内有效,我应该增加该时间。这是为什么呢?
【问题讨论】:
标签: .htaccess caching http-headers pagespeed google-pagespeed