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

Breadcrumb

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

function Response::setImmutable

Marks the response as "immutable".

@final

Return value

$this

File

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

Class

Response
Response represents an HTTP response.

Namespace

Symfony\Component\HttpFoundation

Code

public function setImmutable(bool $immutable = true) : static {
    if ($immutable) {
        $this->headers
            ->addCacheControlDirective('immutable');
    }
    else {
        $this->headers
            ->removeCacheControlDirective('immutable');
    }
    return $this;
}
RSS feed
Powered by Drupal