$responder->expires()
Setter and getter for the cache expiry timestamp for Kirby's cache
$responder->expires(int|string|null $expires = null, bool $override = false): int|null|Kirby\Cms\Responder
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| $expires | intorstringornull |
null
|
Timestamp, number of minutes or time string to parse |
| $override | bool |
false
|
If true, the already defined timestamp will be overridden |
Return types
intornullorKirby\Cms\Responder
This method modifies the existing $responder object it is applied to and returns it again.
Parent class
Examples
return function ($kirby) {
$results = yourApi();
$kirby->response()->expires(1234567890); // timestamp OR
$kirby->response()->expires(60); // minutes OR
$kirby->response()->expires('2021-12-31'); // time string
return compact('results');
};