Last modified: 2010-05-15 15:29:26 UTC
MediaWiki is generating an invalid Expires header. By rfc2616 the Expires
header value should be a date, not a number. Also, by rfc2616, the presence of
a "max-age" directive in the Cache-Control header overrides any Expires header,
regardless of which is more restrictive; so the invalid Expires header doesn't
have any effect on an HTTP 1.1-compliant cache or user agent. (Maybe it's there
trying to cover for caches that don't grok HTTP 1.1 right, but it's still
invalid to put a number there instead of a date.)
The fix is easy: remove the two 'header("Expires: -1")' lines in OutputPage.php.
I haven't tested with all UAs and caches, so if you know this was working
around a problem with a particular UA I'd suggest taking rfc2616's suggestion
about "pre-expiring" a page by naming a date known to be in the past -- that is,
change "Expires: -1" to "Expires: Wed, 31 Dec 2003 00:00:00 GMT".
Loving working with MediaWiki -- thank you!
Created attachment 24 [details]
Fix Last-Modified date formats, eliminate redundant and invalid Expires header
Should have noticed this also: Last-Modified header format needs a leading zero
on day numbers less than 10, which can be done by using 'd' instead of 'j' as
the format character in PHP's gmtime (this is discussed at
http://us4.php.net/gmdate). Attached patch does both changes (remove Expires,
The Expires:-header is for HTTP/1.0 browsers. RFC2616 requires this header to be
if no Cache-Control: is present, to be treated as in the past.
Fixed Last-Modified: headers in GlobalFunctions.php, rev 1.147
*** Bug 1907 has been marked as a duplicate of this bug. ***
Added information about Last-Modified header to summary, to find more easily
patch to this bug.