Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Response.php

function Response::setTtl

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

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

@final

Return value

$this

File

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

Class

Response
Response represents an HTTP response.

Namespace

Symfony\Component\HttpFoundation

Code

public function setTtl(int $seconds) : static {
    $this->setSharedMaxAge($this->getAge() + $seconds);
    return $this;
}
RSS feed
Powered by Drupal