Expires in http header is currently set to:
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Wouldn't it be better to set it to some sane value or to omit it?
Expires in http header is currently set to:
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Wouldn't it be better to set it to some sane value or to omit it?
Which project is this about?
Mediawiki. Core, I'd say. Certainly not wikipedia.
How to reproduce this problem?
Point this at some custom installation of mediawiki.
curl --head http://www.wiki.org/wiki/Main_Page
Then look at the Expires: header.
I fail to find a wiki that does print an Expires: header with the given command.
Reminded me of ancient T2276 and http://stackoverflow.com/questions/24476653/mediawiki-send-wrong-header-expires
The more professional ones most likely remove that header at some level.
Here is one example wiki that does send this header:
curl --head http://wiki.lividinstruments.com/wiki/Brain_V2_and_Brain_Jr._Configure
Sending this header or not might depend on mediawiki settings.
This is done in includes/OutputPage.php. There is twice this line:
$response->header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', 0 ) . ' GMT' );
When I out comment this line, Expires:, it's not longer set to Thu, 01 Jan 1970 00:00:00 GMT. It changes to Expires: Wed, 25 Mar 2015 14:56:10 GMT then.
OutputPage only outputs those headers if caching is explicitly disabled, which works as intended by outputting Cache-Control: max-age=0 as well as the Expires headers with past date (in this case 1970, using 0 as Unix timestamp).