Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. HttpCache.php

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\HttpCache

Code

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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal