HttpCache\Esi (Component\HttpKernel)
Symfony\Component\HttpKernel\HttpCache\Esi
class Esi implements SurrogateInterface
Esi implements the ESI capabilities to Request and Response instances.
For more information, read the following W3C notes:
ESI Language Specification 1.0 (http://www.w3.org/TR/esi-lang)
Edge Architecture Specification (http://www.w3.org/TR/edge-arch)
Methods
__construct(array $contentTypes = array('text/html', 'text/xml', 'application/xhtml+xml', 'application/xml')) Constructor. | ||
string | getName() Returns surrogate name. | |
ResponseCacheStrategyInterface | createCacheStrategy() Returns a new cache strategy instance. | |
bool | hasSurrogateCapability(Request $request) Checks that at least one surrogate has ESI/1.0 capability. | |
addSurrogateCapability(Request $request) Adds ESI/1.0 capability to the given Request. | ||
addSurrogateControl(Response $response) Adds HTTP headers to specify that the Response needs to be parsed for ESI. | ||
bool | needsParsing(Response $response) Checks that the Response needs to be parsed for ESI tags. | |
string | renderIncludeTag(string $uri, string $alt = null, bool $ignoreErrors = true, string $comment = '') Renders an ESI tag. | |
Response | process(Request $request, Response $response) Replaces a Response ESI tags with the included resource content. | |
string | handle(HttpCache $cache, string $uri, string $alt, bool $ignoreErrors) Handles an ESI from the cache. |
Details
public __construct(array $contentTypes = array('text/html', 'text/xml', 'application/xhtml+xml', 'application/xml'))
Constructor.
public string getName()
Returns surrogate name.
public ResponseCacheStrategyInterface createCacheStrategy()
Returns a new cache strategy instance.
public bool hasSurrogateCapability(Request $request)
Checks that at least one surrogate has ESI/1.0 capability.
public addSurrogateCapability(Request $request)
Adds ESI/1.0 capability to the given Request.
public addSurrogateControl(Response $response)
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.
public bool needsParsing(Response $response)
Checks that the Response needs to be parsed for ESI tags.
public string renderIncludeTag(string $uri, string $alt = null, bool $ignoreErrors = true, string $comment = '')
Renders an ESI tag.
public Response process(Request $request, Response $response)
Replaces a Response ESI tags with the included resource content.
public string handle(HttpCache $cache, string $uri, string $alt, bool $ignoreErrors)
Handles an ESI from the cache.
© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.0/Symfony/Component/HttpKernel/HttpCache/Esi.html