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

Breadcrumb

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

function HttpCache::terminate

Overrides TerminableInterface::terminate

File

vendor/symfony/http-kernel/HttpCache/HttpCache.php, line 239

Class

HttpCache
Cache provides HTTP caching.

Namespace

Symfony\Component\HttpKernel\HttpCache

Code

public function terminate(Request $request, Response $response) : void {
    // Do not call any listeners in case of a cache hit.
    // This ensures identical behavior as if you had a separate
    // reverse caching proxy such as Varnish and the like.
    if (\in_array('fresh', $this->traces[$this->getTraceKey($request)] ?? [], true)) {
        return;
    }
    if ($this->getKernel() instanceof TerminableInterface) {
        $this->getKernel()
            ->terminate($request, $response);
    }
}

API Navigation

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