public function Esi::needsEsiParsing

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

Parameters

Response $response A Response instance:

Return value

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

File

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

Class

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

Namespace

Symfony\Component\HttpKernel\HttpCache

Code

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