You are here

public function Response::setSharedMaxAge in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/Response.php \Symfony\Component\HttpFoundation\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.

Parameters

int $value Number of seconds:

Return value

Response

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.

File

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

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;
}