mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-09-23 10:20:12 +00:00
Remove failed experiment $wgCiteCacheReferences
This was briefly enabled in WMF production in 2009 and found not to work. As far as I know, it's been disabled since then. Retaining it requires maintaining the complex "half-parsed serialization" feature in the core parser, which I'm deprecating in I838d7ac7f9a218. The core feature was added solely to support this Cite caching experiment and is not used for anything else. Change-Id: I446e0c46913a390dbdf7b49b84040bf47ed6c2f9
This commit is contained in:
parent
df166f11cd
commit
db85682b63
|
@ -94,7 +94,6 @@
|
|||
"cite": "GlobalVarConfig::newInstance"
|
||||
},
|
||||
"config": {
|
||||
"CiteCacheReferences": false,
|
||||
"CiteStoreReferencesData": false,
|
||||
"CiteCacheReferencesDataOnParse": false,
|
||||
"CiteVisualEditorOtherGroup": false,
|
||||
|
|
|
@ -757,30 +757,8 @@ class Cite {
|
|||
"\n" . implode( "\n", $ent ) . "\n"
|
||||
);
|
||||
|
||||
// Let's try to cache it.
|
||||
global $wgCiteCacheReferences, $wgMemc;
|
||||
$data = [];
|
||||
if ( $wgCiteCacheReferences ) {
|
||||
$cacheKey = $wgMemc->makeKey(
|
||||
'citeref',
|
||||
md5( $parserInput ),
|
||||
$this->mParser->Title()->getArticleID()
|
||||
);
|
||||
$data = $wgMemc->get( $cacheKey );
|
||||
}
|
||||
|
||||
if ( !$data || !$this->mParser->isValidHalfParsedText( $data ) ) {
|
||||
// Live hack: parse() adds two newlines on WM, can't reproduce it locally -ævar
|
||||
$ret = rtrim( $this->mParser->recursiveTagParse( $parserInput ), "\n" );
|
||||
|
||||
if ( $wgCiteCacheReferences ) {
|
||||
$serData = $this->mParser->serializeHalfParsedText( $ret );
|
||||
$wgMemc->set( $cacheKey, $serData, 86400 );
|
||||
}
|
||||
|
||||
} else {
|
||||
$ret = $this->mParser->unserializeHalfParsedText( $data );
|
||||
}
|
||||
// Live hack: parse() adds two newlines on WM, can't reproduce it locally -ævar
|
||||
$ret = rtrim( $this->mParser->recursiveTagParse( $parserInput ), "\n" );
|
||||
|
||||
if ( $responsive ) {
|
||||
// Use a DIV wrap because column-count on a list directly is broken in Chrome.
|
||||
|
|
Loading…
Reference in a new issue