WebPagetest Forums
Cache headers detection - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: WebPagetest (/forumdisplay.php?fid=7)
+--- Forum: Bugs/Issues (/forumdisplay.php?fid=10)
+--- Thread: Cache headers detection (/showthread.php?tid=15476)

Cache headers detection - benjiiim - 08-20-2018 09:10 PM

Hi there,

I have an issue when testing https://www.alpha-croisiere.com/fr/accueil.aspx
Webpagetest is telling me that the two following resources have no max-age or expires headers:
- https://www.alpha-croisiere.com/bundles/style?v=zteHZiiDD1qP86VvWDMgE3TgekwBmdjBJdwoVHcDAX01
- https://www.alpha-croisiere.com/bundles/alphaJs?v=zfn0KMQo-td4HbemfqqzTCyfyGNrnV4zSDBzds_F51I1

However, when using F12 or Fiddler to double check, I can see the following headers, with an expiration date set to 1 year:
Cache-Control: public
Content-Encoding: gzip
Date: Mon, 20 Aug 2018 09:56:42 GMT
Expires: Tue, 20 Aug 2019 09:56:43 GMT
Last-Modified: Mon, 20 Aug 2018 09:56:43 GMT
Vary: User-Agent,Accept-Encoding

Am I doing something wrong?

Thanks a lot.

RE: Cache headers detection - pmeenan - 08-24-2018 03:51 AM

Not entirely sure. The code is definitely getting tripped up because there is both a Cache-Control header and an Expires header. Usually Cache-Control is preferred if it is present but in this case the Cache-Control header doesn't include a max-age and just includes public:

HTTP/1.1 200 OK
Cache-Control: public
Transfer-Encoding: chunked
Content-Type: text/css; charset=utf-8
Content-Encoding: gzip
Expires: Fri, 23 Aug 2019 17:45:02 GMT
Last-Modified: Thu, 23 Aug 2018 17:45:02 GMT
Vary: User-Agent,Accept-Encoding
Date: Thu, 23 Aug 2018 17:45:01 GMT

I honestly don't know how browsers will react to that. If possible, I'd encourage changing the Cache-Control to be "public, max-age=31536000".

RE: Cache headers detection - benjiiim - 08-24-2018 09:24 PM

Thanks a lot Patrick.
I'm not sure neither if that was really an issue or not, but I've added the max-age directive to the response just in case.