is current request cachable?

@param Request $request
@return bool
179533
private function isCachable(Request $request)
    {
        if ($this->cachable === null) {
            $this->cachable = $request->method() === 'GET' && !app()->environment('local') && $this->minutesToCache > 0;
        }

        return $this->cachable;
    }
128392
public function supports(Request $request)
    {
        $routeParameters = $request->get('_route_params');

        if (!is_array($routeParameters)) {
            return false;
        }

        if (!key_exists(LAGAdminBundle::REQUEST_PARAMETER_ADMIN, $routeParameters) ||
            !key_exists(LAGAdminBundle::REQUEST_PARAMETER_ACTION, $routeParameters)
        ) {
            return false;
        }

        if (!$this->resourceCollection->has($routeParameters[LAGAdminBundle::REQUEST_PARAMETER_ADMIN])) {
            return false;
        }

        return true;
    }
251773
public function shouldPrerenderPage(Request $request)
    {
        //if it contains _escaped_fragment_, show prerendered page
        if (null !== $request->query->get('_escaped_fragment_')) {
            return true;
        }

        // First, return false if User Agent is not a bot
        if (!$this->isCrawler($request)) {
            return false;
        }

        $uri = $request->getScheme().'://'.$request->getHost().$request->getRequestUri();

        // Then, return false if URI string contains an ignored extension
        if ($this->isIgnoredExtension($uri)) {
            return false;
        }

        // Then, return true if it is whitelisted (only if whitelist contains data)
        if (!empty($this->whitelistedUrls) && !$this->isWhitelisted($uri, $this->whitelistedUrls)) {
            return false;
        }

        // Finally, return false if it is blacklisted (or the referer)
        $referer = $request->headers->get('Referer');
        $blacklistUrls = $this->blacklistedUrls;

        if ($this->isBlacklisted($uri, $referer, $blacklistUrls)) {
            return false;
        }

        return true;
    }
869648
function isCached()
    {
        $file = $this->cache_dir . '/' . base64_encode($_SERVER['REQUEST_URI']) . '.html';
        if (!file_exists($file))
        {
            return false;
        }
        elseif (filemtime($file) + $this->expire < time())
        {
            return false;
        }
        else
        {
            return true;
        }
    }
1074006
private function checkForUserIdWithinSession(Request $request): bool
    {
        return $this->session->has($request, self::USER_KEY);
    }
90038
public function shouldCheckCache(Request $req)
    {
        if ($req->getMethod() === $req::METHOD_POST) {
            return false;
        }

        $app = Application::getFacadeApplication();
        $config = $app->make('config');
        $cookie = $app->make('cookie');
        $loginCookie = sprintf('%s_LOGIN', $config->get('concrete.session.name'));
        if ($cookie->has($loginCookie) && $cookie->get($loginCookie)) {
            return false;
        }

        return true;
    }
934611
public function isValid (Request $request)
		{
			$parsed = $this->parseRouteRequest($request);

			return $this->getBaseUri($request) !== null
				&& preg_match('#^' . preg_quote(rtrim($this->getBaseUri($request), '/'), '#') . '#', rtrim($request->getUri(false), '/'))
				&& $this->getController($request)->respondsTo($parsed['method'], $parsed['arguments']);
		}
201558
public function setRequest(Request $request)
    {
        $context = (new RequestContext())->fromRequest($request);

        $this->cachedRoot = null;
        $this->cachedSchema = null;
        return $this->setContext($context);
    }
1371201
public function lock(Request $request)
    {
        $key = $this->getCacheKey($request);

        if (!isset($this->locks[$key])) {
            $path = $this->getPath($key);
            if (!file_exists(\dirname($path)) && false === @mkdir(\dirname($path), 0777, true) && !is_dir(\dirname($path))) {
                return $path;
            }
            $h = fopen($path, 'cb');
            if (!flock($h, LOCK_EX | LOCK_NB)) {
                fclose($h);

                return $path;
            }

            $this->locks[$key] = $h;
        }

        return true;
    }
531119
protected function isAllowed($request)
    {
        try {
            $decrypted = Crypt::decrypt($request->get('key'));
        } catch (DecryptException $e) {
            $decrypted = '';
        }

        return $decrypted == 'opcache' || in_array($this->getRequestIp($request), [$this->getServerIp(), '127.0.0.1', '::1']);
    }
153067
public function shouldCacheRequest(Request $request): bool
    {
        if ($request->bearerToken()) {
            return false;
        }

        return parent::shouldCacheRequest($request);
    }
78663
private function isPrivateRequest(Request $request)
    {
        foreach ($this->options['private_headers'] as $key) {
            $key = strtolower(str_replace('HTTP_', '', $key));

            if ('cookie' === $key) {
                if (\count($request->cookies->all())) {
                    return true;
                }
            } elseif ($request->headers->has($key)) {
                return true;
            }
        }

        return false;
    }
838655
public function allow(Request $request)
    {
        foreach ($this->patterns as $regex)
            if (preg_match(sprintf("#^%s$#i", $regex), $request->getUri()->getPath()))
                return false;

        return true;
    }
481618
public function isRequestedUrlClean(Request\Web $request)
    {
        $server = $request->getServer();
        if (!isset($server['REQUEST_URI'])) {
            throw new Exception('REQUEST_URI is not set');
        }

        return strpos($server['REQUEST_URI'], $this->entryPoint) !== 0;
    }
746079
private function checkType(Request $request)
    {
        $type = 'view';
        if ($request->is('*/create')) {
            $type = 'create';
        } elseif ($request->is('*/edit/*') || $request->is('*/update/*')) {
            $type = 'update';
        } elseif ($request->is('*/delete/*')) {
            $type = 'delete';
        } elseif ($request->is('*/store') && $request->isMethod('post')) {
            if ($request->has('id')) {
                $type = 'update';
            } else {
                $type = 'create';
            }
        }
        
        return $type;
    }
164579
protected function isRequestBodyACollection(Request $request)
    {
        $input = $request->input();

        // Check that the top-level of the body is an array
        if (is_array($input) && count($input) > 0) {

            // Check if the first element is an array (json object)
            $firstChild = array_shift($input);

            if (is_array($firstChild)) {
                return true;
            }
        }

        return false;
    }
893860
public function has(Request $request, string $key): bool
    {
        $exists = $this->getSession($request)->has($key);

        $this->logger->info('session: has key {key}, exists {exists}', ['key' => $key, 'exists' => $exists]);

        return $exists;
    }