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