Merge "filerepo: clean up remote description cache keys"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 27 Jun 2018 22:16:45 +0000 (22:16 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 27 Jun 2018 22:16:45 +0000 (22:16 +0000)
includes/filerepo/file/File.php
includes/filerepo/file/ForeignDBFile.php

index 546b78a..370ebb4 100644 (file)
@@ -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(
index 05df45b..7a982bd 100644 (file)
@@ -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,