$fname = 'AjaxResponse::checkLastModified';
if ( !$timestamp || $timestamp == '19700101000000' ) {
- wfDebug( "$fname: CACHE DISABLED, NO TIMESTAMP\n", 'log' );
+ wfDebug( "$fname: CACHE DISABLED, NO TIMESTAMP", 'private' );
return false;
}
if ( !$wgCachePages ) {
- wfDebug( "$fname: CACHE DISABLED\n", 'log' );
+ wfDebug( "$fname: CACHE DISABLED", 'private' );
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", 'log' );
- wfDebug( "$fname: -- we might send Last-Modified : $lastmod\n", 'log' );
+ wfDebug( "$fname: -- client send If-Modified-Since: $modsince", 'private' );
+ wfDebug( "$fname: -- we might send Last-Modified : $lastmod", 'private' );
if ( ( $ismodsince >= $timestamp )
&& $wgUser->validateCache( $ismodsince ) &&
$this->mLastModified = $lastmod;
wfDebug( "$fname: CACHED client: $ismodsince ; user: {$wgUser->getTouched()} ; " .
- "page: $timestamp ; site $wgCacheEpoch\n", 'log' );
+ "page: $timestamp ; site $wgCacheEpoch", 'private' );
return true;
} else {
wfDebug( "$fname: READY client: $ismodsince ; user: {$wgUser->getTouched()} ; " .
- "page: $timestamp ; site $wgCacheEpoch\n", 'log' );
+ "page: $timestamp ; site $wgCacheEpoch", 'private' );
$this->mLastModified = $lastmod;
}
} else {
- wfDebug( "$fname: client did not send If-Modified-Since header\n", 'log' );
+ wfDebug( "$fname: client did not send If-Modified-Since header", 'private' );
$this->mLastModified = $lastmod;
}
return false;
if ( $mcvalue ) {
# Check to see if the value has been invalidated
if ( $touched <= $mcvalue['timestamp'] ) {
- wfDebug( "Got $mckey from cache\n" );
+ wfDebug( "Got $mckey from cache" );
$this->mText = $mcvalue['value'];
return true;
} else {
- wfDebug( "$mckey has expired\n" );
+ wfDebug( "$mckey has expired" );
}
}
$clientHeader = $this->getRequest()->getHeader( 'If-Modified-Since' );
if ( $clientHeader === false ) {
- wfDebug( __METHOD__ . ": client did not send If-Modified-Since header\n", 'log' );
+ wfDebug( __METHOD__ . ": client did not send If-Modified-Since header", 'private' );
return false;
}
}
wfDebug( __METHOD__ . ": client sent If-Modified-Since: " .
- wfTimestamp( TS_ISO_8601, $clientHeaderTime ) . "\n", 'log' );
+ wfTimestamp( TS_ISO_8601, $clientHeaderTime ), 'private' );
wfDebug( __METHOD__ . ": effective Last-Modified: " .
- wfTimestamp( TS_ISO_8601, $maxModified ) . "\n", 'log' );
+ wfTimestamp( TS_ISO_8601, $maxModified ), 'private' );
if ( $clientHeaderTime < $maxModified ) {
- wfDebug( __METHOD__ . ": STALE, $info\n", 'log' );
+ wfDebug( __METHOD__ . ": STALE, $info", 'private' );
return false;
}
# Not modified
# Give a 304 Not Modified response code and disable body output
- wfDebug( __METHOD__ . ": NOT MODIFIED, $info\n", 'log' );
+ wfDebug( __METHOD__ . ": NOT MODIFIED, $info", 'private' );
ini_set( 'zlib.output_compression', 0 );
$this->getRequest()->response()->statusHeader( 304 );
$this->sendCacheControl();
# We'll purge the proxy cache explicitly, but require end user agents
# to revalidate against the proxy on each visit.
# Surrogate-Control controls our CDN, Cache-Control downstream caches
- wfDebug( __METHOD__ . ": proxy caching with ESI; {$this->mLastModified} **\n", 'log' );
+ wfDebug( __METHOD__ . ": proxy caching with ESI; {$this->mLastModified} **", 'private' );
# start with a shorter timeout for initial testing
# header( 'Surrogate-Control: max-age=2678400+2678400, content="ESI/1.0"');
$response->header( 'Surrogate-Control: max-age=' . $config->get( 'SquidMaxage' )
# to revalidate against the proxy on each visit.
# IMPORTANT! The CDN needs to replace the Cache-Control header with
# Cache-Control: s-maxage=0, must-revalidate, max-age=0
- wfDebug( __METHOD__ . ": local proxy caching; {$this->mLastModified} **\n", 'log' );
+ wfDebug( __METHOD__ . ": local proxy caching; {$this->mLastModified} **", 'private' );
# start with a shorter timeout for initial testing
# header( "Cache-Control: s-maxage=2678400, must-revalidate, max-age=0" );
$response->header( 'Cache-Control: s-maxage=' . $this->mCdnMaxage
} else {
# We do want clients to cache if they can, but they *must* check for updates
# on revisiting the page.
- wfDebug( __METHOD__ . ": private caching; {$this->mLastModified} **\n", 'log' );
+ wfDebug( __METHOD__ . ": private caching; {$this->mLastModified} **", 'private' );
$response->header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', 0 ) . ' GMT' );
$response->header( "Cache-Control: private, must-revalidate, max-age=0" );
}
$response->header( "Last-Modified: {$this->mLastModified}" );
}
} else {
- wfDebug( __METHOD__ . ": no caching **\n", 'log' );
+ wfDebug( __METHOD__ . ": no caching **", 'private' );
# In general, the absence of a last modified header should be enough to prevent
# the client from using its cache. We send a few other things just to make sure.