* (bug 22918) Feed cache keys now use $wgRenderHashAppend (so that it doesn't mix...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sun, 4 Apr 2010 13:38:12 +0000 (13:38 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sun, 4 Apr 2010 13:38:12 +0000 (13:38 +0000)
* Modified the timestamp key to use all parameters, otherwise various entries are sharing the same timestamp key and thus some of them can be served even though they are out of date. Consider the following case:
** Two requests for feeds sharing the same timestamp key are done
** Someone edits a page (or whatever else that change the recentchanges table)
** A user request one of the two feed above, the feed is correctly re-generated and the timestamp key changed
** A request for the other feed is done, this time the timestamp is the one of the request just above and the cached version will be served (even though it should not)

Based on a patch by Bawolff.

RELEASE-NOTES
includes/ChangesFeed.php

index b0552f4..65f3cab 100644 (file)
@@ -81,6 +81,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   when using rebuildFileCache.php
 * (bug 22496) Viewing diff of a redirect page without specifying "oldid"
   parameter no longer makes the page displayed as being the redirect target
+* (bug 22918) Feed cache keys now use $wgRenderHashAppend
 
 === API changes in 1.17 ===
 * (bug 22738) Allow filtering by action type on query=logevent
index bc50fe0..1cc18d3 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