* (bug 17537) Disable bad zlib.output_compression output on HTTP 304 responses

Patch by ezyang - http://bug-attachment.wikimedia.org/attachment.cgi?id=5829
This commit is contained in:
Brion Vibber 2009-03-18 21:26:57 +00:00
parent c6bbfa7d71
commit ae98c49213
4 changed files with 4 additions and 0 deletions

View file

@ -277,6 +277,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
* (bug 11487) Special:Protectedpages doesn't list protections with pr_expiry
IS NULL
* (bug 18018) Deleting a file redirect leaves behind a malfunctioning redirect
* (bug 17537) Disable bad zlib.output_compression output on HTTP 304 responses
== API changes in 1.15 ==
* (bug 16858) Revamped list=deletedrevs to make listing deleted contributions

View file

@ -178,6 +178,7 @@ class AjaxResponse {
wfDebug( "$fname: -- client send If-Modified-Since: " . $modsince . "\n", false );
wfDebug( "$fname: -- we might send Last-Modified : $lastmod\n", false );
if( ($ismodsince >= $timestamp ) && $wgUser->validateCache( $ismodsince ) && $ismodsince >= $wgCacheEpoch ) {
ini_set('zlib.output_compression', 0);
$this->setResponseCode( "304 Not Modified" );
$this->disable();
$this->mLastModified = $lastmod;

View file

@ -233,6 +233,7 @@ class OutputPage {
# Not modified
# Give a 304 response code and disable body output
wfDebug( __METHOD__ . ": NOT MODIFIED, $info\n", false );
ini_set('zlib.output_compression', 0);
$wgRequest->response()->header( "HTTP/1.1 304 Not Modified" );
$this->sendCacheControl();
$this->disable();

View file

@ -48,6 +48,7 @@ function wfStreamFile( $fname, $headers = array() ) {
$modsince = preg_replace( '/;.*$/', '', $_SERVER['HTTP_IF_MODIFIED_SINCE'] );
$sinceTime = strtotime( $modsince );
if ( $stat['mtime'] <= $sinceTime ) {
ini_set('zlib.output_compression', 0);
header( "HTTP/1.0 304 Not Modified" );
return;
}