From: Aaron Schulz Date: Mon, 26 Sep 2011 03:37:20 +0000 (+0000) Subject: Cache negative results for interwiki prefix checks. Also helps filecache fail-over... X-Git-Tag: 1.31.0-rc.0~27422 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=8ecde9b038143ff8370965c8ff8908097737f7d8;p=lhc%2Fweb%2Fwiklou.git Cache negative results for interwiki prefix checks. Also helps filecache fail-over mode if DB is down. --- diff --git a/includes/interwiki/Interwiki.php b/includes/interwiki/Interwiki.php index ac9bee7657..f19919fbc2 100644 --- a/includes/interwiki/Interwiki.php +++ b/includes/interwiki/Interwiki.php @@ -151,6 +151,9 @@ class Interwiki { if ( !$iwData ) { $key = wfMemcKey( 'interwiki', $prefix ); $iwData = $wgMemc->get( $key ); + if ( $iwData === '!EMPTY' ) { + return false; // negative cache hit + } } if( $iwData && is_array( $iwData ) ) { // is_array is hack for old keys @@ -175,6 +178,8 @@ class Interwiki { ); $wgMemc->add( $key, $mc, $wgInterwikiExpiry ); return $iw; + } else { + $wgMemc->add( $key, '!EMPTY', $wgInterwikiExpiry ); // negative cache hit } return false;