You are here

public function Esi::addSurrogateControl in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-kernel/HttpCache/Esi.php \Symfony\Component\HttpKernel\HttpCache\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:

Overrides SurrogateInterface::addSurrogateControl

File

vendor/symfony/http-kernel/HttpCache/Esi.php, line 129

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"');
  }
}