利用浏览器缓存-过期日期没有被设置


Leverage browser caching - expiry dates are not being set

我使用https://developers.google.com/speed/pagespeed/insights/,它显示我的网站上的每个图像都没有被缓存。我试过使用W3 Total Cache,用这个编辑。htaccess:

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>
## EXPIRES CACHING ##

:

<filesMatch ".(ico|pdf|flv|jpg|svg|jpeg|png|gif|js|css|swf)$">
Header set Cache-Control "max-age=84600, public"
</filesMatch> 

代码,但无济于事。为什么图像没有被缓存?有办法解决这个问题吗?

PageSpeed的链接:https://developers.google.com/speed/pagespeed/insights/?url=darbas.pcz.lt

提前感谢!

你需要加上plus这个词才能使它工作,

否则你说的是expires when its accessed one month。这没有意义。

ExpiresActive On
ExpiresDefault "access plus 14 days"
ExpiresByType application/javascript "access plus 30 days"
ExpiresByType text/css "access plus 30 days"
ExpiresByType application/x-httpd-php "access plus 30 seconds"