From: Tim Starling Date: Thu, 16 Mar 2006 02:57:44 +0000 (+0000) Subject: Save the last modified timestamp to the parser cache, to avoid the need for a revisio... X-Git-Tag: 1.6.0~203 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=ff375dd5f78978fb8d5159c25782448b7e198233;p=lhc%2Fweb%2Fwiklou.git Save the last modified timestamp to the parser cache, to avoid the need for a revision row load on hits. --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 3517e45d4d..b90faf87cb 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -360,7 +360,7 @@ class OutputPage { * * @return bool */ - function tryParserCache( $article, $user ) { + function tryParserCache( &$article, $user ) { $parserCache =& ParserCache::singleton(); $parserOutput = $parserCache->get( $article, $user ); if ( $parserOutput !== false ) { diff --git a/includes/ParserCache.php b/includes/ParserCache.php index d9a7c849b6..712c664cdf 100644 --- a/includes/ParserCache.php +++ b/includes/ParserCache.php @@ -78,8 +78,10 @@ class ParserCache { } $this->mMemc->delete( $key ); $value = false; - } else { + if ( isset( $value->mTimestamp ) ) { + $article->mTimestamp = $value->mTimestamp; + } wfIncrStats( "pcache_hit" ); } } else { @@ -97,6 +99,10 @@ class ParserCache { $key = $this->getKey( $article, $user ); $now = wfTimestampNow(); $parserOutput->setCacheTime( $now ); + + // Save the timestamp so that we don't have to load the revision row on view + $parserOutput->mTimestamp = $article->getTimestamp(); + $parserOutput->mText .= "\n\n"; wfDebug( "Saved in parser cache with key $key and timestamp $now\n" );