You are here

public function Esi::needsParsing 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::needsParsing()

Checks that the Response needs to be parsed for ESI tags.

Parameters

Response $response A Response instance:

Return value

bool true if the Response needs to be parsed, false otherwise

Overrides SurrogateInterface::needsParsing

1 call to Esi::needsParsing()
Esi::needsEsiParsing in vendor/symfony/http-kernel/HttpCache/Esi.php
Checks that the Response needs to be parsed for ESI tags.

File

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

Class

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

Namespace

Symfony\Component\HttpKernel\HttpCache

Code

public function needsParsing(Response $response) {
  if (!($control = $response->headers
    ->get('Surrogate-Control'))) {
    return false;
  }
  return (bool) preg_match('#content="[^"]*ESI/1.0[^"]*"#', $control);
}