public function saveCache($cacheKey, $data, $cacheTags, $lifetime = self::DEFAULT_LIFETIME) { $this->localCache[$cacheKey] = $data; if (!is_string($data)) { $data = serialize($data); } $this->cache->save($data, $cacheKey, $cacheTags, $lifetime); }
/** * {@inheritDoc} */ public function getSpellingType(RequestInterface $request) { $cacheKey = $this->getCacheKey($request); $spellingType = $this->cacheHelper->loadCache($cacheKey); if ($spellingType === false) { $spellingType = $this->loadSpellingType($request); $this->cacheHelper->saveCache($cacheKey, $spellingType, [$request->getIndex()]); } return $spellingType; }