class Esi
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. |
||
| EsiResponseCacheStrategyInterface |
createCacheStrategy()
Returns a new cache strategy instance. |
|
| Boolean |
hasSurrogateEsiCapability(Request $request)
Checks that at least one surrogate has ESI/1.0 capability. |
|
|
addSurrogateEsiCapability(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. |
||
| Boolean |
needsEsiParsing(Response $response)
Checks that the Response needs to be parsed for ESI tags. |
|
| string |
renderIncludeTag(string $uri, string $alt = null, Boolean $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, Boolean $ignoreErrors)
Handles an ESI from the cache. |
Details
at line 39
public
__construct(array $contentTypes = array('text/html', 'text/xml', 'application/xhtml+xml', 'application/xml'))
Constructor.
at line 49
public EsiResponseCacheStrategyInterface
createCacheStrategy()
Returns a new cache strategy instance.
at line 61
public Boolean
hasSurrogateEsiCapability(Request $request)
Checks that at least one surrogate has ESI/1.0 capability.
at line 75
public
addSurrogateEsiCapability(Request $request)
Adds ESI/1.0 capability to the given Request.
at line 90
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.
at line 104
public Boolean
needsEsiParsing(Response $response)
Checks that the Response needs to be parsed for ESI tags.
at line 123
public string
renderIncludeTag(string $uri, string $alt = null, Boolean $ignoreErrors = true, string $comment = '')
Renders an ESI tag.
at line 146
public Response
process(Request $request, Response $response)
Replaces a Response ESI tags with the included resource content.
at line 195
public string
handle(HttpCache $cache, string $uri, string $alt, Boolean $ignoreErrors)
Handles an ESI from the cache.