r98109 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98108‎ | r98109 | r98110 >
Date:03:37, 26 September 2011
Author:aaron
Status:resolved
Tags:
Comment:
Cache negative results for interwiki prefix checks. Also helps filecache fail-over mode if DB is down.
Modified paths:
  • /trunk/phase3/includes/interwiki/Interwiki.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/interwiki/Interwiki.php
@@ -151,6 +151,9 @@
152152 if ( !$iwData ) {
153153 $key = wfMemcKey( 'interwiki', $prefix );
154154 $iwData = $wgMemc->get( $key );
 155+ if ( $iwData === '!EMPTY' ) {
 156+ return false; // negative cache hit
 157+ }
155158 }
156159
157160 if( $iwData && is_array( $iwData ) ) { // is_array is hack for old keys
@@ -175,6 +178,8 @@
176179 );
177180 $wgMemc->add( $key, $mc, $wgInterwikiExpiry );
178181 return $iw;
 182+ } else {
 183+ $wgMemc->add( $key, '!EMPTY', $wgInterwikiExpiry ); // negative cache hit
179184 }
180185
181186 return false;

Follow-up revisions

RevisionCommit summaryAuthorDate
r98189FU r98109: !EMPTY -> !NONEXISTENT (more consistent with elsewhere)aaron22:46, 26 September 2011
r114912Purge the cached value from memcached....platonides20:00, 15 April 2012

Status & tagging log