public function 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.

@api

Parameters

integer $value Number of seconds:

Return value

Response

2 calls to Response::setMaxAge()
Response::setCache in drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Response.php
Sets the response's cache headers (validation and/or expiration).
Response::setClientTtl in drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Response.php
Sets the response's time-to-live for private/client caches.

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Response.php, line 702

Class

Response
Response represents an HTTP response.

Namespace

Symfony\Component\HttpFoundation

Code

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