public function Response::setTtl

Sets the response's time-to-live for shared caches.

This method adjusts the Cache-Control/s-maxage directive.

@api

Parameters

integer $seconds Number of seconds:

Return value

Response

File

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

Class

Response
Response represents an HTTP response.

Namespace

Symfony\Component\HttpFoundation

Code

public function setTtl($seconds) {
  $this
    ->setSharedMaxAge($this
    ->getAge() + $seconds);
  return $this;
}