interface SurrogateInterface

Methods

string
getName()

Returns surrogate name.

createCacheStrategy()

Returns a new cache strategy instance.

bool
hasSurrogateCapability(Request$request)

Checks that at least one surrogate has Surrogate capability.

void
addSurrogateCapability(Request$request)

Adds Surrogate-capability to the given Request.

void
addSurrogateControl(Response$response)

Adds HTTP headers to specify that the Response needs to be parsed for Surrogate.

bool
needsParsing(Response$response)

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

string
renderIncludeTag(string$uri,string$alt =null,bool$ignoreErrors =true,string$comment ='')

Renders a Surrogate tag.

Response
process(Request$request,Response$response)

Replaces a Response Surrogate tags with the included resource content.

string
handle(HttpCache$cache,string$uri,string$alt,bool$ignoreErrors)

Handles a Surrogate from the cache.

Details

string getName()

Returns surrogate name.

Return Value

string

ResponseCacheStrategyInterface createCacheStrategy()

Returns a new cache strategy instance.

bool hasSurrogateCapability(Request$request)

Checks that at least one surrogate has Surrogate capability.

Parameters

Request $request

Return Value

bool

void addSurrogateCapability(Request$request)

Adds Surrogate-capability to the given Request.

Parameters

Request $request

Return Value

void

void addSurrogateControl(Response$response)

Adds HTTP headers to specify that the Response needs to be parsed for Surrogate.

This method only adds an Surrogate HTTP header if the Response has some Surrogate tags.

Parameters

Response $response

Return Value

void

bool needsParsing(Response$response)

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

Parameters

Response $response

Return Value

bool

string renderIncludeTag(string$uri,string$alt =null,bool$ignoreErrors =true,string$comment ='')

Renders a Surrogate tag.

Parameters

string $uri
string $alt
bool $ignoreErrors
string $comment

Return Value

string

Response process(Request$request,Response$response)

Replaces a Response Surrogate tags with the included resource content.

Parameters

Request $request
Response $response

Return Value

Response

string handle(HttpCache$cache,string$uri,string$alt,bool$ignoreErrors)

Handles a Surrogate from the cache.

Parameters

HttpCache $cache
string $uri
string $alt
bool $ignoreErrors

Return Value

string

Exceptions

RuntimeException
Exception