Retrieve a fully cached page from cache.

@deprecated Deprecated since 3.1, to be removed in 4.0. @see \Silex\HttpCache

@return \Symfony\Component\HttpFoundation\Response|bool
770084
public function fetchCachedRequest()
    {
        Deprecated::method(3.3);

        $response = false;
        if ($this->checkCacheConditions('request', true)) {
            $key = md5($this->app['request']->getPathInfo() . $this->app['request']->getQueryString());

            $result = $this->app['cache']->fetch($key);

            // If we have a result, prepare a Response.
            if (!empty($result)) {
                $response = new Response($result, Response::HTTP_OK);

                // Note that we set the cache-control header to _half_ the
                // maximum duration, otherwise a proxy/cache might keep the
                // cache twice as long in the worst case scenario, and now it's
                // only 50% max, but likely less
                // 's_maxage' sets the cache for shared caches.
                // max_age sets it for regular browser caches

                $age = $this->cacheDuration() / 2;

                $response->setMaxAge($age)->setSharedMaxAge($age);
            }
        }

        return $response;
    }
625868
public function clearCache()
    {
        if ($this->connector->getURL() === null) {
            return 'Cannot find site URL from configuration.';
        }
        $url = $this->connector->getURL().self::VERSION.$this->connector->getSiteID().'/cache-clear';
        $params = [];
        $response = $this->connector->connecting($url, $params, 'POST');

        return $response;
    }
710616
public function getData()
    {
        if ($this->cacheProvider !== null &&
            $this->cacheProvider->contains('routerCache')) {
            return $this->cacheProvider->fetch('routerCache');
        }

        return parent::getData();
    }
460625
public function clearCacheAction() {
        $this->getConfigurationManager()->clearCache();
        $this->addFlash('sonata_flash_success', 'Cache clear successfully');

        return new \Symfony\Component\HttpFoundation\RedirectResponse($this->admin->generateUrl('list'));
    }
408205
public function get()
    {
        if (Cache::has($this->getCacheKey()))
            return Cache::get($this->getCacheKey());

        return $this->create();
    }
1157218
public function getCacheFrontend() {
		if ($this->_cacheFrontendWrapper === null) {
			// Try the personal frontend for the service
			if ($this instanceof LocatorAwareInterface && $this->hasLocator()) {
				$locator   = $this->getLocator();
				$serviceId = $this->getCacheFrontendServiceId();
				
				if ($locator->has($serviceId)) {
					$this->_cacheFrontendWrapper = $locator->get($serviceId);
					return $this->_cacheFrontendWrapper;
				}
			}
			
			// Try to create through a factory
			if ($this->hasCacheFrontendFactory() && method_exists($this, 'getServiceName')) {
				$this->_cacheFrontendWrapper = $this->getCacheFrontendFactory()->createWrapper($this->getServiceName());
				return $this->_cacheFrontendWrapper;
			}
			
			throw new NoFrontend('Unable to provide the cache frontend');
		}
		
		return $this->_cacheFrontendWrapper;
	}
1348242
public function getTemplate()
    {
        if (!$this->useCaching()) {
            $result = $this->renderTemplate();
        } else {
            $cache = Injector::inst()->get(CacheInterface::class . '.PageSlices');
            if (!$cache->has($this->getCacheKey())) {
                $result = $this->renderTemplate();
                $cache->set($this->getCacheKey(), $result);
            } else {
                $result = $cache->get($this->getCacheKey());
            }
        }

        return $result;
    }
1106671
public function getResultCacheDriver()
    {
        if ($this->queryCacheProfile && $this->queryCacheProfile->getResultCacheDriver()) {
            return $this->queryCacheProfile->getResultCacheDriver();
        }

        return $this->em->getConfiguration()->getResultCacheImpl();
    }
949483
protected function cache()
    {
        return method_exists($this->cache, 'tags') ? $this->cache->tags($this->tag) : $this->cache;
    }
449937
public function getCacheRepository()
    {
        if (is_null($this->cacheRepository)) {
            $this->cacheRepository = app(config('repository.cache.repository', 'cache'));
        }

        return $this->cacheRepository;
    }
758381
protected function getPageCache($cache_type)
    {
        $route_info = Lb::app()->getRouteInfo();
        $page_cache_key = implode('_', ['page_cache', $route_info['controller'], $route_info['action']]);
        return Lb::app()->getCache($page_cache_key, $cache_type);
    }
659191
public function getCache()
    {
        if ($this->cache) {
            return $this->cache;
        }

        if (property_exists($this, 'app') && $this->app instanceof ServiceContainer
            && isset($this->app['cache']) && $this->app['cache'] instanceof CacheInterface) {
            return $this->cache = $this->app['cache'];
        }

        return $this->cache = $this->createDefaultCache();
    }
1152404
public function cacheDelay()
    {
        return $this->handler->cacheDelay->client($this->product, $this->crawlDelay()->getValue());
    }
3207
protected function _getCacheControl()
    {
        $cache = array();
        $response = $this->getResponse();

        if($response->getUser()->isAuthentic()) {
            $cache = array('private');
        } else {
            $cache = array('public');
        }

        if(0 == $cache['max-age'] = $response->getMaxAge()) {
            $cache[] = 'no-cache';
        };

        return $cache;
    }
1097848
protected function getCachedView()
    {
        if ($this->hasCachedView()) {
            $key = $this->getCacheKey();

            return $this->cache->get($key);
        }

        return false;
    }
194093
public static function getFrontCache()
    {
        if (self::$frontCache === null) {
            self::$frontCache = new \Phalcon\Cache\Frontend\Data(self::$frontCacheData);
        }
        return self::$frontCache;
    }
978065
public function getCachedContent()
    {
        if ($this->_content !== null) {
            return $this->_content;
        }

        $this->_content = false;

        if (!($this->cache instanceof CacheInterface)) {
            return $this->_content;
        }

        $key = $this->calculateKey();
        $data = $this->cache->get($key);
        if (!is_array($data) || count($data) !== 2) {
            return $this->_content;
        }

        [$this->_content, $placeholders] = $data;
        if (!is_array($placeholders) || count($placeholders) === 0) {
            return $this->_content;
        }

        $this->_content = $this->updateDynamicContent($this->_content, $placeholders, true);

        return $this->_content;
    }