X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FAjaxResponse.php;h=4b5ca75eb0ca71211903f1d0f77b1e75fd371ca5;hb=1b10209f6817fef422aa6cd2b923e5696320ca1c;hp=ac8a9f097d2ef6560b17f7230d0db2273aaac16b;hpb=994abbd1836b0b12185272d905457713ed3a2a2a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/AjaxResponse.php b/includes/AjaxResponse.php index ac8a9f097d..4b5ca75eb0 100644 --- a/includes/AjaxResponse.php +++ b/includes/AjaxResponse.php @@ -28,7 +28,6 @@ * @ingroup Ajax */ class AjaxResponse { - /** * Number of seconds to get the response cached by a proxy * @var int $mCacheDuration @@ -184,10 +183,10 @@ class AjaxResponse { } } else { - # Let the client do the caching. Cache is not purged. header ( "Expires: " . gmdate( "D, d M Y H:i:s", time() + $this->mCacheDuration ) . " GMT" ); - header ( "Cache-Control: s-maxage={$this->mCacheDuration},public,max-age={$this->mCacheDuration}" ); + header ( "Cache-Control: s-maxage={$this->mCacheDuration}," . + "public,max-age={$this->mCacheDuration}" ); } } else { @@ -215,7 +214,7 @@ class AjaxResponse { $fname = 'AjaxResponse::checkLastModified'; if ( !$timestamp || $timestamp == '19700101000000' ) { - wfDebug( "$fname: CACHE DISABLED, NO TIMESTAMP\n" ); + wfDebug( "$fname: CACHE DISABLED, NO TIMESTAMP\n", 'log' ); return false; } @@ -237,17 +236,22 @@ class AjaxResponse { wfDebug( "$fname: -- client send If-Modified-Since: " . $modsince . "\n", 'log' ); wfDebug( "$fname: -- we might send Last-Modified : $lastmod\n", 'log' ); - if ( ( $ismodsince >= $timestamp ) && $wgUser->validateCache( $ismodsince ) && $ismodsince >= $wgCacheEpoch ) { + if ( ( $ismodsince >= $timestamp ) + && $wgUser->validateCache( $ismodsince ) && + $ismodsince >= $wgCacheEpoch + ) { ini_set( 'zlib.output_compression', 0 ); $this->setResponseCode( "304 Not Modified" ); $this->disable(); $this->mLastModified = $lastmod; - wfDebug( "$fname: CACHED client: $ismodsince ; user: {$wgUser->getTouched()} ; page: $timestamp ; site $wgCacheEpoch\n", 'log' ); + wfDebug( "$fname: CACHED client: $ismodsince ; user: {$wgUser->getTouched()} ; " . + "page: $timestamp ; site $wgCacheEpoch\n", 'log' ); return true; } else { - wfDebug( "$fname: READY client: $ismodsince ; user: {$wgUser->getTouched()} ; page: $timestamp ; site $wgCacheEpoch\n", 'log' ); + wfDebug( "$fname: READY client: $ismodsince ; user: {$wgUser->getTouched()} ; " . + "page: $timestamp ; site $wgCacheEpoch\n", 'log' ); $this->mLastModified = $lastmod; } } else {