Index: trunk/extensions/Cite/Cite_body.php |
— | — | @@ -367,19 +367,25 @@ |
368 | 368 | $cacheKey = wfMemcKey( 'citeref', md5($parserInput), $this->mParser->Title()->getArticleID() ); |
369 | 369 | |
370 | 370 | wfProfileOut( __METHOD__ .'-entries' ); |
371 | | - |
372 | | - wfProfileIn( __METHOD__.'-cache-get' ); |
373 | | - $data = $wgMemc->get( $cacheKey ); |
374 | | - wfProfileOut( __METHOD__.'-cache-get' ); |
375 | 371 | |
376 | | - if ( !$data ) { |
| 372 | + global $wgCiteCacheReferences; |
| 373 | + if ( $wgCiteCacheReferences ) { |
| 374 | + wfProfileIn( __METHOD__.'-cache-get' ); |
| 375 | + $data = $wgMemc->get( $cacheKey ); |
| 376 | + wfProfileOut( __METHOD__.'-cache-get' ); |
| 377 | + } |
| 378 | + |
| 379 | + if ( empty($data) ) { |
377 | 380 | wfProfileIn( __METHOD__ .'-parse' ); |
378 | 381 | |
379 | 382 | // Live hack: parse() adds two newlines on WM, can't reproduce it locally -ævar |
380 | 383 | $ret = rtrim( $this->parse( $parserInput ), "\n" ); |
381 | | - $serData = $this->mParser->serialiseHalfParsedText( $ret ); |
382 | | - $wgMemc->set( $cacheKey, $serData, 86400 ); |
383 | 384 | |
| 385 | + if ( $wgCiteCacheReferences ) { |
| 386 | + $serData = $this->mParser->serialiseHalfParsedText( $ret ); |
| 387 | + $wgMemc->set( $cacheKey, $serData, 86400 ); |
| 388 | + } |
| 389 | + |
384 | 390 | wfProfileOut( __METHOD__ .'-parse' ); |
385 | 391 | } else { |
386 | 392 | $ret = $this->mParser->unserialiseHalfParsedText( $data ); |
Index: trunk/extensions/Cite/Cite.php |
— | — | @@ -45,6 +45,11 @@ |
46 | 46 | */ |
47 | 47 | $wgAllowCiteGroups = true; |
48 | 48 | |
| 49 | +/** |
| 50 | + * An emergency optimisation measure for caching cite <references /> output. |
| 51 | + */ |
| 52 | +$wgCiteCacheReferences = false; |
| 53 | + |
49 | 54 | function wfCite() { |
50 | 55 | new Cite; |
51 | 56 | return true; |