From 87f4d002cc0151d4bb1dd1c3d9f9e9bec15e706a Mon Sep 17 00:00:00 2001 From: Ori Livneh Date: Mon, 11 Apr 2016 16:41:57 -0700 Subject: [PATCH] Cache first-letter data in APC, if available I noticed that `frwiki:first-letters:fr:fr:4.8.1.1` was at the very top of keys sorted by bandwidth (that is, reqs/sec * size) on one of the memcache servers on WMF prod. The data takes ~60 - 80ms to compute, in case of a cache miss. That's not enough to justify using a tiered cache abstraction here, IMO. Change-Id: If81ce8f86f2c378565f1f6a0dd2c04dee825c4e9 --- includes/collation/IcuCollation.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/collation/IcuCollation.php b/includes/collation/IcuCollation.php index 0aa14065aa..942036b696 100644 --- a/includes/collation/IcuCollation.php +++ b/includes/collation/IcuCollation.php @@ -240,8 +240,8 @@ class IcuCollation extends Collation { return $this->firstLetterData; } - $cache = wfGetCache( CACHE_ANYTHING ); - $cacheKey = wfMemcKey( + $cache = ObjectCache::getLocalServerInstance( CACHE_ANYTHING ); + $cacheKey = $cache->makeKey( 'first-letters', $this->locale, $this->digitTransformLanguage->getCode(), -- 2.20.1