Mobile app version of vmapp.org
Login or Join
Angela700

: What can I do in regards to the GPSI complaint on cache-control on dynamic images? I ran google page-speed tests on my website again and it stated this... Setting an expiry date or a

@Angela700

Posted in: #Cache #GooglePagespeed #Images

I ran google page-speed tests on my website again and it stated this...


Setting an expiry date or a maximum age in the HTTP headers for static resources instructs the browser to load previously downloaded resources from local disk rather than over the network.
Leverage browser caching...


It lists all external files on my site including adsense code files. When I read google's documentation, it states I should make the images cached for at least a week but the problem here is that some of my images listed change at least twice a week if not more.

I have already applied Etag and Last-modified headers to the affected images and have had the server issue a 304 status when the images haven't yet been modified.

I feel my only way to improve my score is to crank the cache to a week or more and make users hit refresh in their web browsers every time images are updated on the site.

Many thumbnails of the large images on the site are part of a sprite sheet and when a large image is removed, the sprite sheet is recreated. If I choose to remove an image quickly with a large cache set and then keep browsing then it will appear as if the image hasn't been removed unless I hit refresh. This is why right now I have my cache set to 8 seconds.

I'm thinking increasing it but I don't know the magic number, but I certainly can't meet the one-week minimum google suggests.

Can anyone give me advice on the best cache value I should use to make google happy and why that value?

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Angela700

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme