r64596 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64595‎ | r64596 | r64597 >
Date:13:38, 4 April 2010
Author:ialex
Status:ok
Tags:
Comment:
* (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.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/ChangesFeed.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ChangesFeed.php
@@ -46,17 +46,17 @@
4747 */
4848 public function execute( $feed, $rows, $lastmod, $opts ) {
4949 global $messageMemc, $wgFeedCacheTimeout;
50 - global $wgSitename, $wgLang;
 50+ global $wgSitename, $wgLang, $wgRenderHashAppend;
5151
5252 if ( !FeedUtils::checkFeedOutput( $this->format ) ) {
5353 return;
5454 }
5555
56 - $timekey = wfMemcKey( $this->type, $this->format, 'timestamp' );
57 - $optionsHash = md5( serialize( $opts->getAllValues() ) );
 56+ $optionsHash = md5( serialize( $opts->getAllValues() ) ) . $wgRenderHashAppend;
 57+ $timekey = wfMemcKey( $this->type, $this->format, $wgLang->getCode(), $optionsHash, 'timestamp' );
5858 $key = wfMemcKey( $this->type, $this->format, $wgLang->getCode(), $optionsHash );
5959
60 - FeedUtils::checkPurge($timekey, $key);
 60+ FeedUtils::checkPurge( $timekey, $key );
6161
6262 /*
6363 * Bumping around loading up diffs can be pretty slow, so where
Index: trunk/phase3/RELEASE-NOTES
@@ -81,6 +81,7 @@
8282 when using rebuildFileCache.php
8383 * (bug 22496) Viewing diff of a redirect page without specifying "oldid"
8484 parameter no longer makes the page displayed as being the redirect target
 85+* (bug 22918) Feed cache keys now use $wgRenderHashAppend
8586
8687 === API changes in 1.17 ===
8788 * (bug 22738) Allow filtering by action type on query=logevent

Status & tagging log