X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FRevision.php;h=6acc528f76bcde938da16cabfb024d5df1cab6cc;hb=956967415397d64f7c67259f190e8122a0b32506;hp=0f8d0bd1d2644467de78705f0422774992c56b2e;hpb=6281fb4aadd203ba80650a0e6cea7794bf52a756;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Revision.php b/includes/Revision.php index 0f8d0bd1d2..6acc528f76 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -1577,19 +1577,20 @@ class Revision implements IDBAccessObject { * @return string|bool The revision's text, or false on failure */ private function loadText() { - // Caching may be beneficial for massive use of external storage global $wgRevisionCacheExpiry; - if ( !$wgRevisionCacheExpiry ) { - return $this->fetchText(); - } - $cache = ObjectCache::getMainWANInstance(); + if ( $cache->getQoS( $cache::ATTR_EMULATION ) <= $cache::QOS_EMULATION_SQL ) { + // Do not cache RDBMs blobs in...the RDBMs store + $ttl = $cache::TTL_UNCACHEABLE; + } else { + $ttl = $wgRevisionCacheExpiry ?: $cache::TTL_UNCACHEABLE; + } // No negative caching; negative hits on text rows may be due to corrupted replica DBs return $cache->getWithSetCallback( - $key = $cache->makeKey( 'revisiontext', 'textid', $this->getTextId() ), - $wgRevisionCacheExpiry, + $cache->makeKey( 'revisiontext', 'textid', $this->getTextId() ), + $ttl, function () { return $this->fetchText(); },