You are here

public function Ssi::addSurrogateControl in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-kernel/HttpCache/Ssi.php \Symfony\Component\HttpKernel\HttpCache\Ssi::addSurrogateControl()

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

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

Parameters

Response $response A Response instance:

Overrides SurrogateInterface::addSurrogateControl

File

vendor/symfony/http-kernel/HttpCache/Ssi.php, line 84

Class

Ssi
Ssi implements the SSI capabilities to Request and Response instances.

Namespace

Symfony\Component\HttpKernel\HttpCache

Code

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