class KillSwitch implements ResponsePolicyInterface (View source)

A policy evaluating to static::DENY when the kill switch was triggered.

Properties

protected bool $kill

A flag indicating whether the kill switch was triggered.

Methods

string|null
check(Response $response, Request $request)

Determines whether it is save to store a page in the cache.

trigger()

Deny any page caching on the current request.

Details

string|null check(Response $response, Request $request)

Determines whether it is save to store a page in the cache.

Parameters

Response $response

The response which is about to be sent to the client.

Request $request

The request object.

Return Value

string|null

Either static::DENY or NULL. Calling code may attempt to store a page in the cache unless static::DENY is returned. Returns NULL if the policy policy is not specified for the given response.

trigger()

Deny any page caching on the current request.