Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does WordPress use 11 Jan 1984 as an anti-caching value for Expires headers?

Tags:

wordpress

The Expires header can be set to a date in the past to prevent caching, although this seems to be regarded as an unusual practice. Any date before today should work for this purpose, but Wordpress uses the very specific date of Wed, 11 Jan 1984 05:00:00 GMT for some reason. I'm pretty sure that WP is the origin of this practice since all discussions involving this date appear to be about WordPress, and this article specifically calls out the Expires header value as a sign of a WordPress server. This blog post remarks upon the unusual date but has nothing very useful to offer about it (unless the cache control headers are meant to honor the death of Fritz Geissler).

It seems to me like it would have been better practice to choose a more generic timestamp like 1 Jan 1900 00:00:00 GMT to avoid surprise at the specificity. It has demonstrably caused some degree of confusion (albeit not much), as can be seen from this forum post. Does anybody know what this date's significance is or why the WordPress developers chose it? I can only assume it's some kind of Easter egg, but it'd be neat to find out the details.

like image 814
Hydrothermal Avatar asked Jan 02 '19 20:01

Hydrothermal


People also ask

What will happen if you set an Expires header to a later date say 1 day )?

When you set an expires header for a resource, such as all jpeg images, the browser will store those resources in its cache. The next time the visitor comes back to the page it will load faster, as the browser will already have those images available.

What are expire headers in Wordpress?

What are Expires Headers? Expires headers tell the browsers what resource can be stored and fetched from the browser's cache or the source itself. In effect, it'll help your site load faster by being able to display certain elements from the cache and not having to get it from the server.

What does expires header mean?

The expires header is an HTTP header that indicates whether it is possible to obtain information on request from the browser cache or if you need to access the server since the page option in the cache is already outdated. This header contains the date and time until the page is available in the browser cache.


1 Answers

Looks like this goes back to WordPress version 2.1.

Doing a bit of digging, the first use of this date in a functions.php was in commit 2623, where it was used in the nocache_headers() function.

Prior to that, it had been copied & pasted around a few times. I think the first instance of this was commit 1983, where the non-cachable date in one case was changed from the birthdate of "Michel" (maybe Michel Valdrighi?) to the 1984 date. The message on that commit is:

Don't cache. No, really. Hat tip: Kimmo Suominen.

That commit came from Matt Mullenweg, whose birthday is listed as 11 January 1984 by Wikipedia.

like image 170
s3cur3 Avatar answered Nov 03 '22 01:11

s3cur3