Symfony\Component\HttpKernel\HttpCache\HttpCache::isFreshEnough PHP Method

isFreshEnough() protected method

Checks whether the cache entry is "fresh enough" to satisfy the Request.
protected isFreshEnough ( Request $request, Response $entry ) : boolean
$request Symfony\Component\HttpFoundation\Request A Request instance
$entry Symfony\Component\HttpFoundation\Response A Response instance
return boolean true if the cache entry if fresh enough, false otherwise
    protected function isFreshEnough(Request $request, Response $entry)
    {
        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;
    }