mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-28 00:40:12 +00:00
Avoid calculating md5 when not caching references
In the old caching system for references, the cache key needs the md5 of the references, but it shouldn't be calculated when one is not using this caching system. Change-Id: I83c17d1df5c5e620ea21d1bf955b86ce94bc119a
This commit is contained in:
parent
0a77a3d2a3
commit
b991617bc6
|
@ -729,15 +729,17 @@ class Cite {
|
||||||
// We add new lines between the pieces to avoid a confused tidy (bug 13073).
|
// We add new lines between the pieces to avoid a confused tidy (bug 13073).
|
||||||
$parserInput = $prefix . "\n" . $content . "\n" . $suffix;
|
$parserInput = $prefix . "\n" . $content . "\n" . $suffix;
|
||||||
|
|
||||||
// Let's try to cache it.
|
|
||||||
global $wgMemc;
|
|
||||||
$cacheKey = wfMemcKey( 'citeref', md5( $parserInput ), $this->mParser->Title()->getArticleID() );
|
|
||||||
|
|
||||||
wfProfileOut( __METHOD__ . '-entries' );
|
wfProfileOut( __METHOD__ . '-entries' );
|
||||||
|
|
||||||
global $wgCiteCacheReferences;
|
// Let's try to cache it.
|
||||||
|
global $wgCiteCacheReferences, $wgMemc;
|
||||||
$data = false;
|
$data = false;
|
||||||
if ( $wgCiteCacheReferences ) {
|
if ( $wgCiteCacheReferences ) {
|
||||||
|
$cacheKey = wfMemcKey(
|
||||||
|
'citeref',
|
||||||
|
md5( $parserInput ),
|
||||||
|
$this->mParser->Title()->getArticleID()
|
||||||
|
);
|
||||||
wfProfileIn( __METHOD__ . '-cache-get' );
|
wfProfileIn( __METHOD__ . '-cache-get' );
|
||||||
$data = $wgMemc->get( $cacheKey );
|
$data = $wgMemc->get( $cacheKey );
|
||||||
wfProfileOut( __METHOD__ . '-cache-get' );
|
wfProfileOut( __METHOD__ . '-cache-get' );
|
||||||
|
|
Loading…
Reference in a new issue