Last modified: 2010-05-15 15:29:26 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T2276, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 276 - Invalid "Expires" header value: -1; Invalid "Last-Modified" header date format
Invalid "Expires" header value: -1; Invalid "Last-Modified" header date format
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.3.x
All All
: Normal minor (vote)
: ---
Assigned To: Nobody - You can work on this!
http://mbrt.renlabs.com/wiki/
: patch
: 1907 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-09-02 23:12 UTC by Steve Work
Modified: 2010-05-15 15:29 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Fix Last-Modified date formats, eliminate redundant and invalid Expires header (2.01 KB, patch)
2004-09-02 23:50 UTC, Steve Work
Details

Description Steve Work 2004-09-02 23:12:03 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!
Comment 1 Steve Work 2004-09-02 23:50:03 UTC
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,
correct Last-Modified).
Comment 2 JeLuF 2005-01-22 09:03:46 UTC
The Expires:-header is for HTTP/1.0 browsers. RFC2616 requires this header to be
ignored, or,
if no Cache-Control: is present, to be treated as in the past.

Fixed Last-Modified: headers in GlobalFunctions.php, rev 1.147
Comment 3 Brion Vibber 2005-04-17 05:58:24 UTC
*** Bug 1907 has been marked as a duplicate of this bug. ***
Comment 4 Jakub Narebski 2005-06-03 11:06:21 UTC
Added information about Last-Modified header to summary, to find more easily
patch to this bug.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links