function Response::setStaleIfError
Sets the number of seconds after which the response should no longer be returned by shared caches when backend is down.
This method sets the Cache-Control stale-if-error directive.
@final
Return value
$this
1 call to Response::setStaleIfError()
- Response::setCache in vendor/
symfony/ http-foundation/ Response.php - Sets the response's cache headers (validation and/or expiration).
File
-
vendor/
symfony/ http-foundation/ Response.php, line 802
Class
- Response
- Response represents an HTTP response.
Namespace
Symfony\Component\HttpFoundationCode
public function setStaleIfError(int $value) : static {
$this->headers
->addCacheControlDirective('stale-if-error', $value);
return $this;
}