Corrected spelling error
[lhc/web/wiklou.git] / includes / ParserCache.php
index 8066e4f..8634a3b 100644 (file)
@@ -18,11 +18,20 @@ class ParserCache
                $hash = $user->getPageRenderingHash();
                $pageid = intval( $article->getID() );
                $key = $this->getKey( $article, $user );
+               wfDebug( "Trying parser cache $key\n" );
                $value = $wgMemc->get( $key );
                if ( $value ) {
+                       wfDebug( "Found.\n" );
                        # Delete if article has changed since the cache was made
-                       $touched = $article->getTouched();
-                       if ( $value->getCacheTime() <= $touched || $value->getCacheTime < $wgCacheEpoch ) {
+                       $canCache = $article->checkTouched();
+                       $cacheTime = $value->getCacheTime();
+                       $touched = $article->mTouched;
+                       if ( !$canCache || $value->getCacheTime() <= $touched || $cacheTime < $wgCacheEpoch ) {
+                               if ( !$canCache ) {
+                                       wfDebug( "Invalid cached redirect, touched $touched, epoch $wgCacheEpoch, cached $cacheTime\n" );
+                               } else {
+                                       wfDebug( "Key expired, touched $touched, epoch $wgCacheEpoch, cached $cacheTime\n" );
+                               }
                                $wgMemc->delete( $key );
                                $value = false;
                        }
@@ -36,6 +45,7 @@ class ParserCache
        
        function save( $parserOutput, &$article, &$user ){
                global $wgMemc;
+
                $key = $this->getKey( $article, $user );
                $now = wfTimestampNow();
                $parserOutput->setCacheTime( $now );