1

In terms of load speed optimisation, is Cache-Control: max-age=0 with an If-Modified-Since date a problem? My browser reports a 304, but tools like Google's PageSpeed and YSlow flag them as a problem on account of the short (non-existent) "freshness lifetime".

I've read through this question and some of the linked resources but, while helpful, I'm still not clear on the net effect (if any) for load speed.

Many thanks.

Community
  • 1
  • 1
GDVS
  • 418
  • 2
  • 10
  • 1
    304 means the client browser still goes over the internet to validate the content and the webserver still needs to respond to and process the request to decide to do a 304 or a content-based 200 response. These are hard delays which impact load speeds. If the content has a (validly) defined life then the browser can optimise this all away and fetch the data from a local cache -- which is normally far faster. – TerryE Sep 28 '12 at 17:07
  • @TerryE Ah, thank you, I think I see. I think I was expecting it not to cache at all, whereas in fact it is caching but the short max-age means the browser always has to check the server. So with a longer max-age, I'd see a 200 (from cache). Have I got that right? – GDVS Sep 29 '12 at 17:26
  • 1
    Use the firebug or equiv Chrome / IE ... dev toolkit to instrument the client end and see what is going on. The [Google Pagespeed best practices](https://developers.google.com/speed/docs/best-practices/rules_intro) are a mine of useful info to help you get up to speed. And yes to your Q the longer the max-age, the longer that the browser will go directly to its local cache. – TerryE Oct 02 '12 at 17:48

0 Answers0