*/
function checkLastModified ( $timestamp ) {
global $wgCachePages, $wgCacheEpoch, $wgUser;
+ $fname = 'OutputPage::checkLastModified';
+
if ( !$timestamp || $timestamp == '19700101000000' ) {
- wfDebug( "CACHE DISABLED, NO TIMESTAMP\n" );
+ wfDebug( "$fname: CACHE DISABLED, NO TIMESTAMP\n" );
return;
}
if( !$wgCachePages ) {
- wfDebug( "CACHE DISABLED\n", false );
+ wfDebug( "$fname: CACHE DISABLED\n", false );
return;
}
if( $wgUser->getOption( 'nocache' ) ) {
- wfDebug( "USER DISABLED CACHE\n", false );
+ wfDebug( "$fname: USER DISABLED CACHE\n", false );
return;
}
$modsince = preg_replace( '/;.*$/', '', $_SERVER["HTTP_IF_MODIFIED_SINCE"] );
$modsinceTime = strtotime( $modsince );
$ismodsince = wfTimestamp( TS_MW, $modsinceTime ? $modsinceTime : 1 );
- wfDebug( "-- client send If-Modified-Since: " . $modsince . "\n", false );
- wfDebug( "-- we might send Last-Modified : $lastmod\n", false );
+ 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 ) {
# Make sure you're in a place you can leave when you call us!
header( "HTTP/1.0 304 Not Modified" );
$this->mLastModified = $lastmod;
$this->sendCacheControl();
- wfDebug( "CACHED client: $ismodsince ; user: $wgUser->mTouched ; page: $timestamp ; site $wgCacheEpoch\n", false );
+ wfDebug( "$fname: CACHED client: $ismodsince ; user: $wgUser->mTouched ; page: $timestamp ; site $wgCacheEpoch\n", false );
$this->disable();
@ob_end_clean(); // Don't output compressed blob
return true;
} else {
- wfDebug( "READY client: $ismodsince ; user: $wgUser->mTouched ; page: $timestamp ; site $wgCacheEpoch\n", false );
+ wfDebug( "$fname: READY client: $ismodsince ; user: $wgUser->mTouched ; page: $timestamp ; site $wgCacheEpoch\n", false );
$this->mLastModified = $lastmod;
}
} else {
- wfDebug( "client did not send If-Modified-Since header\n", false );
+ wfDebug( "$fname: client did not send If-Modified-Since header\n", false );
$this->mLastModified = $lastmod;
}
}