You are here

public function Response::setMaxAge in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/Response.php \Symfony\Component\HttpFoundation\Response::setMaxAge()

Sets the number of seconds after which the response should no longer be considered fresh.

This methods sets the Cache-Control max-age directive.

Parameters

int $value Number of seconds:

Return value

Response

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.

File

vendor/symfony/http-foundation/Response.php, line 727

Class

Response
Response represents an HTTP response.

Namespace

Symfony\Component\HttpFoundation

Code

public function setMaxAge($value) {
  $this->headers
    ->addCacheControlDirective('max-age', $value);
  return $this;
}