WebPagetest Forums
Cache Static Content showing as failed even though Expiry Header is set to 2 months - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: WebPagetest (/forumdisplay.php?fid=7)
+--- Forum: Bugs/Issues (/forumdisplay.php?fid=10)
+--- Thread: Cache Static Content showing as failed even though Expiry Header is set to 2 months (/showthread.php?tid=15100)



Cache Static Content showing as failed even though Expiry Header is set to 2 months - vikrammaduri05 - 10-26-2017 05:55 PM

In optimization summary, Leverage Cache of Static Content showing as failed, but Expiry header was already set to 2 months.

Refer attachement 1 for Optimization Summary
Refer attachement 2 for Response Header Details(where Expiry header is set 2 months)


RE: Cache Static Content showing as failed even though Expiry Header is set to 2 months - paulcalvano - 10-27-2017 03:57 AM

Hello! It looks like your Cache-Control header has two max-age directives. The first is for 600s (10 minutes) and the second is for 5184000 seconds (60 days). Your expires header seems to correlate with the 60 day value.

According to the HTTP specification, a browser should prefer the Cache-Control max-age directive over the Expires header if both are present (see https://tools.ietf.org/html/rfc7234#section-4.2.1). You are sending two max-age directives, but there's a good chance that a client will use the first max-age directive it finds - since it's uncommon for a server to send more than one...

I was able to validate that this is what is happening in Firefox, since about:cache will let you see what the browser calculated how long the object will be stored in it's cache. When I load it in Firefox, the browser will only cache it for 10 minutes.

Below is what I was able to find it about:cache for this entry -

Cache entry information
key: https://ww.heatcraftrpdqa.com/_ui/responsive/theme-lambda/assets/quote_pricing_noerror.png
fetch count: 1
last fetched: 2017-10-26 13:39:32
last modified: 2017-10-26 13:39:33
expires: 2017-10-26 13:49:32
Data size: 18346 B
Security: This is a secure document.