Get the ETag from the cached response.

@param \Psr\Cache\CacheItemInterface $cacheItem

@return string|null
18457
protected function getETag(CacheItemInterface $cacheItem)
    {
        $data = $cacheItem->get();

        foreach ($data['etag'] as $etag) {
            if (!empty($etag)) {
                return $etag;
            }
        }
    }
861824
public function getContents($cacheKey)
    {
        $cacheInfo = $this->getCache($cacheKey);
        if (!$cacheInfo) {
            throw new ApplicationException(Lang::get('system::lang.combiner.not_found', ['name'=>$cacheKey]));
        }

        $this->localPath = $cacheInfo['path'];
        $this->storagePath = storage_path('cms/combiner/assets');

        /*
         * Analyse cache information
         */
        $lastModifiedTime = gmdate("D, d M Y H:i:s \G\M\T", array_get($cacheInfo, 'lastMod'));
        $etag = array_get($cacheInfo, 'etag');
        $mime = (array_get($cacheInfo, 'extension') == 'css')
            ? 'text/css'
            : 'application/javascript';

        /*
         * Set 304 Not Modified header, if necessary
         */
        header_remove();
        $response = Response::make();
        $response->header('Content-Type', $mime);
        $response->header('Cache-Control', 'private, max-age=604800');
        $response->setLastModified(new DateTime($lastModifiedTime));
        $response->setEtag($etag);
        $response->setPublic();
        $modified = !$response->isNotModified(App::make('request'));

        /*
         * Request says response is cached, no code evaluation needed
         */
        if ($modified) {
            $this->setHashOnCombinerFilters($cacheKey);
            $combiner = $this->prepareCombiner($cacheInfo['files']);
            $contents = $combiner->dump();
            $response->setContent($contents);
        }

        return $response;
    }
68988
static function contextCache( $contextName )
    {
        $translationCache = eZTranslationCache::cacheTable();
        if ( isset( $translationCache[$contextName] ) )
        {
            return $translationCache[$contextName]['root'];
        }
        return null;
    }
579522
private function getFromCache(string $class): ?ClassMetadataInterface
    {
        if (null === $this->cache) {
            return null;
        }

        if ($this->cache instanceof Cache) {
            $cached = $this->cache->fetch($class) ?: null;
        } else {
            $class = preg_replace('#[\{\}\(\)/\\\\@:]#', '_', str_replace('_', '__', $class));
            $item = $this->cache->getItem($class);
            $cached = $item->isHit() ? $item->get() : null;
        }

        return $cached;
    }
904065
public function getItem($cacheId, & $success = null)
    {
        $cacheId = $this->normalizeKey($cacheId);
        $success = false;

        $value = $this->extract($this->memcache->get($cacheId));
        if ($value === null) {
            return null;
        }

        $success = true;

        return $value;
    }
1135232
public function cache(CacheItemInterface $item)
    {
        $content = $this->execute();
        $item->set($content);

        return $item;
    }
723498
def cache_etag(request, *argz, **kwz):
	''''''
	response, site, cachekey = kwz.get('_view_data') or initview(request)
	if not response: return None
	return fjcache.str2md5(
		'{0}--{1}--{2}'.format( site.id if site else 'x', cachekey,
			response[1].strftime('%Y-%m-%d %H:%M:%S%z') ) )
852603
public function get($cacheKey)
    {
        // TODO: Refactor for strict types!
        $path = $this->resolvePath($cacheKey, false);
        if (file_exists($path)) {
            return file_get_contents($path);
        }

        return null;
    }
42703
public function getItem($cacheId, & $success = null)
    {
        $cacheId = $this->normalizeKey($cacheId);
        $success = false;

        if (!isset($this->map[$cacheId])) {
            return null;
        }

        $value = $this->extract($this->map[$cacheId]);
        if ($value === null) {
            return null;
        }

        $success = true;

        return $value;
    }
609504
public function getCachedItem($key)
    {
        $path = sha1($key);

        if ($this->filesystem()->has($path)) {
            $item = explode(PHP_EOL, $this->filesystem()->read($path), 2);

            return new CacheItemClass($key, $item[1] ?? null, $item[0] ?? null);
        }
    }
836414
protected function getItemsFromCache()
    {
        return 'cli' === PHP_SAPI ? $this->getItemsFromDatabase() : $this->cache->rememberForever($this->cacheKey, function () {
                    return $this->getItemsFromDatabase();
                });
    }
887806
private function getCachedContent()
    {
        $item = null;

        if (null !== $this->cache) {
            $item = $this->cache->getItem($this->cacheKey);
            $cacheContent = $item->get();

            if ($item->isHit() && null !== $cacheContent) {
                $this->contentCache = $cacheContent;
            }
        }

        return $item;
    }
892277
private function getCache()
    {
        // cache for single run
        // so that getLastModified and getContent in single request do not add additional cache roundtrips (i.e memcache)
        if (isset($this->parsed)) {
            return $this->parsed;
        }

        // check from cache first
        $cache = null;
        $cacheId = $this->getCacheId();
        if ($this->cache->isValid($cacheId, 0)) {
            if ($cache = $this->cache->fetch($cacheId)) {
                $cache = unserialize($cache);
            }
        }

        $input = $cache ? $cache : $this->filepath;

        if ($this->cacheIsStale($cache)) {
            $cache = $this->compile($this->filepath);
        }

        if (!is_array($input) || $cache['updated'] > $input['updated']) {
            $this->cache->store($cacheId, serialize($cache));
        }

        return $this->parsed = $cache;
    }
1131848
protected function getCachePermissions($cacheKey)
    {
        // Check local cache
        if (isset($this->cachePermissions[$cacheKey])) {
            return $this->cachePermissions[$cacheKey];
        }

        // Check persistent cache
        if ($this->cacheService) {
            $result = $this->cacheService->get($cacheKey);

            // Warm local cache
            if ($result) {
                $this->cachePermissions[$cacheKey] = $result;
                return $result;
            }
        }

        return null;
    }
927840
public function getItem($cacheId, & $success = null)
    {
        $cacheId = $this->normalizeKey($cacheId);
        $success = false;

        $storedValue = $this->memcached->get($cacheId);
        if (\Memcached::RES_SUCCESS !== $this->memcached->getResultCode()) {
            return null;
        }

        $value = $this->extract($storedValue);
        if ($value === null) {
            return null;
        }

        $success = true;

        return $value;
    }
682775
public function get($cacheId)
    {
        $this->throwExceptionIfNotExists($cacheId);

        if ($this->expired($cacheId)) {
            return $this->getFromCacheable($cacheId);
        }

        return $this->getCachedItem($cacheId);
    }
1132836
def get(self, CachableItem):
        """"""
        cached_item = self.mapper.get(CachableItem)
        r = self.request('get',
            self.url+"storage/collections/data/"+self.collname+'/'+cached_item.getId(),
            data={'output_mode': 'json'})
        if r.ok:
            # we need to update the object with the values found in the cache area
            data = r.json()
            for name in self.mapper.mapper:
                setattr(cached_item, name, data[name])
            return cached_item
        return None