* (bug 23276) Add hook to Special:NewPages to modify query
[lhc/web/wiklou.git] / includes / ChangesFeed.php
index bc50fe0..4a5a2d1 100644 (file)
@@ -46,17 +46,17 @@ class ChangesFeed {
         */
        public function execute( $feed, $rows, $lastmod, $opts ) {
                global $messageMemc, $wgFeedCacheTimeout;
-               global $wgSitename, $wgLang;
+               global $wgSitename, $wgLang, $wgRenderHashAppend;
 
                if ( !FeedUtils::checkFeedOutput( $this->format ) ) {
                        return;
                }
 
-               $timekey = wfMemcKey( $this->type, $this->format, 'timestamp' );
-               $optionsHash = md5( serialize( $opts->getAllValues() ) );
+               $optionsHash = md5( serialize( $opts->getAllValues() ) ) . $wgRenderHashAppend;
+               $timekey = wfMemcKey( $this->type, $this->format, $wgLang->getCode(), $optionsHash, 'timestamp' );
                $key = wfMemcKey( $this->type, $this->format, $wgLang->getCode(), $optionsHash );
 
-               FeedUtils::checkPurge($timekey, $key);
+               FeedUtils::checkPurge( $timekey, $key );
 
                /*
                * Bumping around loading up diffs can be pretty slow, so where
@@ -102,7 +102,8 @@ class ChangesFeed {
         * @return feed's content on cache hit or false on cache miss
         */
        public function loadFromCache( $lastmod, $timekey, $key ) {
-               global $wgFeedCacheTimeout, $messageMemc;
+               global $wgFeedCacheTimeout, $wgOut, $messageMemc;
+
                $feedLastmod = $messageMemc->get( $timekey );
 
                if( ( $wgFeedCacheTimeout > 0 ) && $feedLastmod ) {
@@ -119,6 +120,9 @@ class ChangesFeed {
 
                        if( $feedAge < $wgFeedCacheTimeout || $feedLastmodUnix > $lastmodUnix) {
                                wfDebug( "RC: loading feed from cache ($key; $feedLastmod; $lastmod)...\n" );
+                               if ( $feedLastmodUnix < $lastmodUnix ) {
+                                       $wgOut->setLastModified( $feedLastmod ); // bug 21916
+                               }
                                return $messageMemc->get( $key );
                        } else {
                                wfDebug( "RC: cached feed timestamp check failed ($feedLastmod; $lastmod)\n" );