You are here

public function Esi::addSurrogateCapability in Zircon Profile 8.0

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

Adds ESI/1.0 capability to the given Request.

Parameters

Request $request A Request instance:

Overrides SurrogateInterface::addSurrogateCapability

1 call to Esi::addSurrogateCapability()
Esi::addSurrogateEsiCapability in vendor/symfony/http-kernel/HttpCache/Esi.php
Adds ESI/1.0 capability to the given Request.

File

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

Class

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

Namespace

Symfony\Component\HttpKernel\HttpCache

Code

public function addSurrogateCapability(Request $request) {
  $current = $request->headers
    ->get('Surrogate-Capability');
  $new = 'symfony2="ESI/1.0"';
  $request->headers
    ->set('Surrogate-Capability', $current ? $current . ', ' . $new : $new);
}