public function Response::setSharedMaxAge

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

This methods sets the Cache-Control s-maxage directive.

@api

Parameters

integer $value Number of seconds:

Return value

Response

2 calls to Response::setSharedMaxAge()
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::setTtl in drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Response.php
Sets the response's time-to-live for shared caches.

File

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

Class

Response
Response represents an HTTP response.

Namespace

Symfony\Component\HttpFoundation

Code

public function setSharedMaxAge($value) {
  $this
    ->setPublic();
  $this->headers
    ->addCacheControlDirective('s-maxage', $value);
  return $this;
}