ResponseCache
in package
FinalYes
Web Page Caching
Tags
Table of Contents
Properties
- $cache : CacheInterface
- $cacheQueryString : bool|array<int, string>
- Whether to take the URL query string into consideration when generating output cache files. Valid options are:
- $ttl : int
- Cache time to live.
Methods
- __construct() : mixed
- get() : ResponseInterface|null
- Gets the cached response for the request.
- make() : bool
- Caches the response.
- setTtl() : $this
Properties
$cache read-only
private
CacheInterface
$cache
$cacheQueryString
Whether to take the URL query string into consideration when generating output cache files. Valid options are:
private
bool|array<int, string>
$cacheQueryString
= false
false = Disabled true = Enabled, take all query parameters into account. Please be aware that this may result in numerous cache files generated for the same page over and over again. array('q') = Enabled, but only take into account the specified list of query parameters.
$ttl
Cache time to live.
private
int
$ttl
= 0
seconds
Methods
__construct()
public
__construct(Cache $config, CacheInterface $cache) : mixed
Parameters
- $config : Cache
- $cache : CacheInterface
get()
Gets the cached response for the request.
public
get(CLIRequest|IncomingRequest $request, ResponseInterface $response) : ResponseInterface|null
Parameters
- $request : CLIRequest|IncomingRequest
- $response : ResponseInterface
Return values
ResponseInterface|nullmake()
Caches the response.
public
make(CLIRequest|IncomingRequest $request, ResponseInterface $response) : bool
Parameters
- $request : CLIRequest|IncomingRequest
- $response : ResponseInterface
Return values
boolsetTtl()
public
setTtl(int $ttl) : $this
Parameters
- $ttl : int