Question

I've put this in my head section. It appears in the page source in the browser.

<meta http-equiv="Cache-Control" content="max-age=1209600">

However, when I look in the Chrome extension Live HTTP Headers, it says the following.

Cache-Control: max-age=0
Content-Encoding: gzip
Content-Length: 5849
Content-Type: text/html; charset=utf-8
Date: Sat, 05 Apr 2014 04:29:16 GMT
Expires: Sat, 05 Apr 2014 04:29:16 GMT
Last-Modified: Sat, 05 Apr 2014 03:33:19 GMT

The max-age isn't registering. I've emptied the browser cache but it makes no difference.

Any explanations? This is the site, incidentally.

UPDATES:

Firebug similarly records Cache-Control: max-age=0.

Google also makes clear here that max-age overrides the Expires header (which I don't set) and that you don't need both.

Was it helpful?

Solution

When you use tools like Live HTTP Headers, they show you the actual HTTP headers sent by the browser. What they do with meta tags used to simulate HTTP headers is a different issue. We can expect any conflict to be resolved in favor of the actual headers. (This has been normatively specified in HTML specs for Content-Type headers.)

To control cacheing, you should (at least primarily) use server configuration. See Caching Tutorial for Web Authors and Webmasters.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top