From: Aaron Schulz Date: Wed, 27 Jun 2018 07:24:00 +0000 (+0100) Subject: filerepo: clean up remote description cache keys X-Git-Tag: 1.34.0-rc.0~4937^2 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=8804df2da5d0bc1b4cbd57696d770e77b76d4434;p=lhc%2Fweb%2Fwiklou.git filerepo: clean up remote description cache keys Hash the file name portion and make the string constant portions more relevant to what the keys are actually used for (e.g. there is no URL parameter in the key) Bug: T198279 Change-Id: Idf6f97db26f5be291cdd3a50a91346677fe9c3e6 --- diff --git a/includes/filerepo/file/File.php b/includes/filerepo/file/File.php index 546b78a0b5..370ebb406b 100644 --- a/includes/filerepo/file/File.php +++ b/includes/filerepo/file/File.php @@ -2068,9 +2068,8 @@ abstract class File implements IDBAccessObject { $cache = MediaWikiServices::getInstance()->getMainWANObjectCache(); $key = $this->repo->getLocalCacheKey( 'RemoteFileDescription', - 'url', $lang->getCode(), - $this->getName() + md5( $this->getName() ) ); return $cache->getWithSetCallback( diff --git a/includes/filerepo/file/ForeignDBFile.php b/includes/filerepo/file/ForeignDBFile.php index 05df45b32f..7a982bd34f 100644 --- a/includes/filerepo/file/ForeignDBFile.php +++ b/includes/filerepo/file/ForeignDBFile.php @@ -155,10 +155,9 @@ class ForeignDBFile extends LocalFile { return $cache->getWithSetCallback( $this->repo->getLocalCacheKey( - 'RemoteFileDescription', - 'url', + 'ForeignFileDescription', $lang->getCode(), - $this->getName(), + md5( $this->getName() ), $touched ), $this->repo->descriptionCacheExpiry ?: $cache::TTL_UNCACHEABLE,