* @ingroup Ajax
*/
class AjaxResponse {
-
/**
* Number of seconds to get the response cached by a proxy
* @var int $mCacheDuration
}
} 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 {
$fname = 'AjaxResponse::checkLastModified';
if ( !$timestamp || $timestamp == '19700101000000' ) {
- wfDebug( "$fname: CACHE DISABLED, NO TIMESTAMP\n" );
+ wfDebug( "$fname: CACHE DISABLED, NO TIMESTAMP\n", 'log' );
return false;
}
if ( !$wgCachePages ) {
- wfDebug( "$fname: CACHE DISABLED\n", false );
+ wfDebug( "$fname: CACHE DISABLED\n", 'log' );
return false;
}
$modsince = preg_replace( '/;.*$/', '', $_SERVER["HTTP_IF_MODIFIED_SINCE"] );
$modsinceTime = strtotime( $modsince );
$ismodsince = wfTimestamp( TS_MW, $modsinceTime ? $modsinceTime : 1 );
- wfDebug( "$fname: -- client send If-Modified-Since: " . $modsince . "\n", false );
- wfDebug( "$fname: -- we might send Last-Modified : $lastmod\n", false );
+ 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", false );
+ 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", false );
+ wfDebug( "$fname: READY client: $ismodsince ; user: {$wgUser->getTouched()} ; " .
+ "page: $timestamp ; site $wgCacheEpoch\n", 'log' );
$this->mLastModified = $lastmod;
}
} else {
- wfDebug( "$fname: client did not send If-Modified-Since header\n", false );
+ wfDebug( "$fname: client did not send If-Modified-Since header\n", 'log' );
$this->mLastModified = $lastmod;
}
return false;