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

Breadcrumb

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

function Response::setPrivate

Marks the response as "private".

It makes the response ineligible for serving other clients.

@final

Return value

$this

2 calls to Response::setPrivate()
BigPipeResponse::populateBasedOnOriginalHtmlResponse in core/modules/big_pipe/src/Render/BigPipeResponse.php
Populates this BigPipeResponse object based on the original HTML response.
Response::setCache in vendor/symfony/http-foundation/Response.php
Sets the response's cache headers (validation and/or expiration).

File

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

Class

Response
Response represents an HTTP response.

Namespace

Symfony\Component\HttpFoundation

Code

public function setPrivate() : static {
    $this->headers
        ->removeCacheControlDirective('public');
    $this->headers
        ->addCacheControlDirective('private');
    return $this;
}
RSS feed
Powered by Drupal