Why does the expiration date of the request cache lie in the past?

939 views Asked by At

I am working on caching some pages and I noticed this in Firebug:

Cache expiration date lying in the past

So it says that the cache expired 45 years ago. Is this a bug or some bad data?

I have another page that is caching correctly

Correct cache expiration date

I just do not understand why its saying Expires ... 1970. This page won't cache at all on my site, even though I'm using the Boost module with Drupal.

1

There are 1 answers

0
Sebastian Zartner On BEST ANSWER

If the Expires header is set to 0, the browser interprets it as 1 January 1970, which relates to the Unix time aka POSIX time. Because this date lies in the past, this means that the request is not cached.

The Expires header is defined within RFC 7234, which includes this paragraph related to the statement above:

A cache recipient MUST interpret invalid date formats, especially the value "0", as representing a time in the past (i.e., "already expired").