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

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 276 - Invalid "Expires" header value: -1; Invalid "Last-Modified" header date format
Invalid "Expires" header value: -1; Invalid "Last-Modified" header date format
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
All All
: Normal minor (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch
: 1907 (view as bug list)
Depends on:
  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: ---

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

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  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.