public function Esi::addSurrogateControl

Adds HTTP headers to specify that the Response needs to be parsed for ESI.

This method only adds an ESI HTTP header if the Response has some ESI tags.

Parameters

Response $response A Response instance:

File

drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/Esi.php, line 90

Class

Esi
Esi implements the ESI capabilities to Request and Response instances.

Namespace

Symfony\Component\HttpKernel\HttpCache

Code

public function addSurrogateControl(Response $response) {
  if (false !== strpos($response
    ->getContent(), '<esi:include')) {
    $response->headers
      ->set('Surrogate-Control', 'content="ESI/1.0"');
  }
}