function HttpCache::isFreshEnough
Checks whether the cache entry is "fresh enough" to satisfy the Request.
1 call to HttpCache::isFreshEnough()
- HttpCache::lookup in vendor/
symfony/ http-kernel/ HttpCache/ HttpCache.php - Lookups a Response from the cache for the given Request.
File
-
vendor/
symfony/ http-kernel/ HttpCache/ HttpCache.php, line 524
Class
- HttpCache
- Cache provides HTTP caching.
Namespace
Symfony\Component\HttpKernel\HttpCacheCode
protected function isFreshEnough(Request $request, Response $entry) : bool {
if (!$entry->isFresh()) {
return $this->lock($request, $entry);
}
if ($this->options['allow_revalidate'] && null !== ($maxAge = $request->headers
->getCacheControlDirective('max-age'))) {
return $maxAge > 0 && $maxAge >= $entry->getAge();
}
return true;
}