@param Route $route
@param string $cacheKey
@param $return

@return bool
967804
private function cacheSet(Route $route, string $cacheKey, $return) : bool
    {
        if ($route->getOption(AbstractRoute::OPTIONS_CACHE)) {
            $second = $route->getOption(AbstractRoute::OPTIONS_CACHE);

            if (self::session()->isStarted()) {
                throw new \LogicException("Can't set a cache on a route that use session data");
            }

            self::response()->addHeader('Expires', gmdate('D, d M Y H:i:s', time() + $second) . ' GMT');
            self::response()->addHeader('Cache-Control', 'public, max-age=' . $second . ', must-revalidate');
            self::response()->addHeader('Pragma', 'public, max-age=' . $second . ', must-revalidate');
            self::response()->addHeader('Vary', 'Accept-Encoding');

            $data = [
                'output' => $return,
                'headers' => self::response()->getHeaders(),
            ];

            self::cache(self::class)->set($cacheKey, $data, $second);
        }

        return true;
    }
437985
public function retrieve($cacheKey)
    {
        if ($this->has($cacheKey)) {
            return $this->cache()->get($cacheKey);
        }

        return false;
    }
986939
protected function remember(string $cacheKey, string $name, array $arguments)
    {
        $cache = Cache::get($cacheKey);
        if ($cache) {
            return $cache;
        }

        $result = call_user_func_array([$this->repository, $name], $arguments);
        $driver = $this->repository->getDriver();
        if ($result instanceof $driver) {
            return $result;
        }

        if (!is_null($result)) {
            Cache::put($cacheKey, $result, $this->cacheMinute);
        }

        return $result;
    }
270689
public function callRouteBefore($route, $request)
	{
		$response = $this->callPatternFilters($route, $request);

		return $response ?: $this->callAttachedBefores($route, $request);
	}
949048
protected static function _checkQueryCache($cache_key, $table_name = null, $connection_name = self::DEFAULT_CONNECTION)
        {
            if(isset(self::$_config[$connection_name]['check_query_cache']) && is_callable(self::$_config[$connection_name]['check_query_cache'])){
                return call_user_func_array(self::$_config[$connection_name]['check_query_cache'], array($cache_key, $table_name, $connection_name));
            } elseif (isset(self::$_query_cache[$connection_name][$cache_key])) {
                return self::$_query_cache[$connection_name][$cache_key];
            }

            return false;
        }
597679
public function cache($result, $key, $duration = null)
    {
        if ($key && $this->getCache()) {
            $this->getCache()->set($key, $result, $duration);
        }
        return $result;
    }
86973
private function store(RouteCollectionInterface $routes, $method)
    {
        call_user_func_array([$this->memcached, $method], [$this->storeId, $routes]);
        call_user_func_array([$this->memcached, $method], [$this->storeId.'.lastmod', time()]);
    }
1239802
public function get($commandKey, $cacheKey)
    {
        if ($this->exists($commandKey, $cacheKey)) {
            return $this->cachedResults[$commandKey][$cacheKey];
        }

        return null;
    }
517972
public function loadCache($cacheKey)
    {
        if (!isset($this->localCache[$cacheKey])) {
            $data = $this->cache->load($cacheKey);

            if ($data) {
                $data = unserialize($data);
            }

            $this->localCache[$cacheKey] = $data;
        }

        return $this->localCache[$cacheKey];
    }
913908
public function match(
       ServerRequestInterface &$request,
       RouteInterface $route): bool
   {
        if ($this->matchAction($request, $route)
         && $this->matchPath($request, $route)) {
            $request = $request->withAttribute("route", $route);
            return true;
        }
        return false;
   }
1188002
private function handleCacheListeners(RequestInterface $request, ResponseInterface $response, $cacheHit, $cacheItem)
    {
        foreach ($this->config['cache_listeners'] as $cacheListener) {
            $response = $cacheListener->onCacheResponse($request, $response, $cacheHit, $cacheItem);
        }

        return $response;
    }
1195942
public function resolveRouteBinding($routeKey)
    {
        if (method_exists($this->wrappedObject, 'resolveRouteBinding') && is_callable([$this->wrappedObject, 'resolveRouteBinding'])) {
            return $this->wrappedObject->resolveRouteBinding($routeKey);
        }

        return $this->wrappedObject->where($this->wrappedObject->getRouteKeyName(), $routeKey)->first();
    }
79558
public function routeMatched(ApiRoute $route, Request $request): void
	{
		if (($format = $request->getParameter(self::API_DOCU_STARTER_QUERY_KEY_GENERATE)) !== null) {
			$this->generator->generateAll($this->router);

			exit(0);
		}

		if (($format = $request->getParameter(self::API_DOCU_STARTER_QUERY_KEY_TARGET)) !== null) {
			$this->generator->generateTarget($route, $request);

			exit(0);
		}
	}
644226
def writeCache(self, cachekey, content):
        """"""
        self.rendercache[cachekey] = content
        try:
            open(cachekey, 'w').write(content)
        except:
            print("Error writing cache file", cachekey, ", will regenerate next time")
            traceback.print_exc()
        return content
796366
function check(CacheKey $key) {

		if (isset ( $this->elements [$key->getModule()] [$key->getProperty()] )) {
			return true;
		} else {
			return false;
		}
	}
523326
function load($key): bool {
    $cacheKey = [__CLASS__, $key];
    $viewRenderer = $this->viewRenderer;

    /** @var \yii\caching\Cache $cache */
    $cache = $viewRenderer->cache;
    if (!$viewRenderer->enableCaching || !$cache->exists($cacheKey)) return false;

    eval("?>{$cache->get($cacheKey)}");
    return true;
  }
632770
public function get($cache_id, $return_data_only = false) {
		$result = $this->object->get($cache_id);
		// if we are debugging
		if (\Debug::$debug) {
			\Debug::$data['cache'][] = array(
				'type' => 'get',
				'link' => $this->object->cache_link,
				'cache_id' => $cache_id,
				'have_data' => $result['success']
			);
			// todo: log errors
		}
		// if we need to return data
		if ($return_data_only) {
			if ($result['success']) {
				return $result['data'];
			} else {
				return false;
			}
		} else {
			return $result;
		}
	}