function Response::setMaxAge
Sets the number of seconds after which the response should no longer be considered fresh.
This method sets the Cache-Control max-age directive.
@final
Return value
$this
2 calls to Response::setMaxAge()
- Response::setCache in vendor/
symfony/ http-foundation/ Response.php - Sets the response's cache headers (validation and/or expiration).
- Response::setClientTtl in vendor/
symfony/ http-foundation/ Response.php - Sets the response's time-to-live for private/client caches in seconds.
File
-
vendor/
symfony/ http-foundation/ Response.php, line 786
Class
- Response
- Response represents an HTTP response.
Namespace
Symfony\Component\HttpFoundationCode
public function setMaxAge(int $value) : static {
$this->headers
->addCacheControlDirective('max-age', $value);
return $this;
}