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

Breadcrumb

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

function Response::expire

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

Return value

$this

File

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

Class

Response
Response represents an HTTP response.

Namespace

Symfony\Component\HttpFoundation

Code

public function expire() : static {
    if ($this->isFresh()) {
        $this->headers
            ->set('Age', $this->getMaxAge());
        $this->headers
            ->remove('Expires');
    }
    return $this;
}
RSS feed
Powered by Drupal