PageSpeed Insights wrongly reporting cache policy?

365 views Asked by At

Why is PageSpeed Insights failing the cache policy audit? (I have marked one of the failing resources showing its response headers later):

enter image description here

These are the response headers for the marked resource:

enter image description here

The expiration headers at the top of my .htaccess:

# Caching einrichten
FileETag MTime Size
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/css "access plus 1 weeks"
ExpiresByType application/javascript "access plus 1 weeks"
ExpiresByType application/x-javascript "access plus 1 weeks"
ExpiresByType image/gif "access plus 1 months"
ExpiresByType image/jpeg "access plus 1 months"
ExpiresByType image/png "access plus 1 months"
ExpiresByType image/x-icon "access plus 1 months"
</IfModule>
## EXPIRES CACHING ##
1

There are 1 answers

0
Sham On

We had one year and worked. I don;t know exact period which tool consider has long time but from https://github.com/wp-media/wp-rocket/issues/1345 sounds like it is 4 months. May be you can try by increasing.
Having best cache policy might be tough & various from use case. Look your requirement and set it accordingly. Page insight tool confirms you are setting properly for 30 days in case your use case is to pass audit itself then try 4 months and incrementing till you pass.

Thanks