From a1d9ee26c206933f6f96c06402c6a59839dbbad3 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sun, 4 Apr 2010 13:38:12 +0000 Subject: [PATCH] * (bug 22918) Feed cache keys now use $wgRenderHashAppend (so that it doesn't mix between secure.wikimedia.org and normal sites) * 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 | 1 + includes/ChangesFeed.php | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index b0552f4c37..65f3cab506 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 diff --git a/includes/ChangesFeed.php b/includes/ChangesFeed.php index bc50fe0214..1cc18d300d 100644 --- a/includes/ChangesFeed.php +++ b/includes/ChangesFeed.php @@ -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 -- 2.20.1