SurrogateInterface
in
Table of Contents
- addSurrogateCapability() : mixed
- Adds Surrogate-capability to the given Request.
- addSurrogateControl() : mixed
- Adds HTTP headers to specify that the Response needs to be parsed for Surrogate.
- createCacheStrategy() : ResponseCacheStrategyInterface
- Returns a new cache strategy instance.
- getName() : string
- Returns surrogate name.
- handle() : string
- Handles a Surrogate from the cache.
- hasSurrogateCapability() : bool
- Checks that at least one surrogate has Surrogate capability.
- needsParsing() : bool
- Checks that the Response needs to be parsed for Surrogate tags.
- process() : Response
- Replaces a Response Surrogate tags with the included resource content.
- renderIncludeTag() : string
- Renders a Surrogate tag.
Methods
addSurrogateCapability()
Adds Surrogate-capability to the given Request.
public
addSurrogateCapability(Request $request) : mixed
Parameters
- $request : Request
Return values
mixed —addSurrogateControl()
Adds HTTP headers to specify that the Response needs to be parsed for Surrogate.
public
addSurrogateControl(Response $response) : mixed
This method only adds an Surrogate HTTP header if the Response has some Surrogate tags.
Parameters
- $response : Response
Return values
mixed —createCacheStrategy()
Returns a new cache strategy instance.
public
createCacheStrategy() : ResponseCacheStrategyInterface
Return values
ResponseCacheStrategyInterface —getName()
Returns surrogate name.
public
getName() : string
Return values
string —handle()
Handles a Surrogate from the cache.
public
handle(HttpCache $cache, string $uri, string $alt, bool $ignoreErrors) : string
Parameters
- $cache : HttpCache
- $uri : string
- $alt : string
-
An alternative URI
- $ignoreErrors : bool
Tags
Return values
string —hasSurrogateCapability()
Checks that at least one surrogate has Surrogate capability.
public
hasSurrogateCapability(Request $request) : bool
Parameters
- $request : Request
Return values
bool —needsParsing()
Checks that the Response needs to be parsed for Surrogate tags.
public
needsParsing(Response $response) : bool
Parameters
- $response : Response
Return values
bool —process()
Replaces a Response Surrogate tags with the included resource content.
public
process(Request $request, Response $response) : Response
Parameters
Return values
Response —renderIncludeTag()
Renders a Surrogate tag.
public
renderIncludeTag(string $uri[, string|null $alt = null ][, bool $ignoreErrors = true ][, string $comment = '' ]) : string
Parameters
- $uri : string
- $alt : string|null = null
-
An alternate URI
- $ignoreErrors : bool = true
- $comment : string = ''
-
A comment to add as an esi:include tag