public function Response::expire

Marks the response stale by setting the Age header to be equal to the maximum age of the response.

@api

Return value

Response

File

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

Class

Response
Response represents an HTTP response.

Namespace

Symfony\Component\HttpFoundation

Code

public function expire() {
  if ($this
    ->isFresh()) {
    $this->headers
      ->set('Age', $this
      ->getMaxAge());
  }
  return $this;
}