*
* @return bool
*/
- function tryParserCache( $article, $user ) {
+ function tryParserCache( &$article, $user ) {
$parserCache =& ParserCache::singleton();
$parserOutput = $parserCache->get( $article, $user );
if ( $parserOutput !== false ) {
}
$this->mMemc->delete( $key );
$value = false;
-
} else {
+ if ( isset( $value->mTimestamp ) ) {
+ $article->mTimestamp = $value->mTimestamp;
+ }
wfIncrStats( "pcache_hit" );
}
} else {
$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<!-- Saved in parser cache with key $key and timestamp $now -->\n";
wfDebug( "Saved in parser cache with key $key and timestamp $now\n" );