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

Breadcrumb

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

function Response::setPublic

Marks the response as "public".

It makes the response eligible for serving other clients.

@final

Return value

$this

3 calls to Response::setPublic()
BinaryFileResponse::__construct in vendor/symfony/http-foundation/BinaryFileResponse.php
Response::setCache in vendor/symfony/http-foundation/Response.php
Sets the response's cache headers (validation and/or expiration).
Response::setSharedMaxAge in vendor/symfony/http-foundation/Response.php
Sets the number of seconds after which the response should no longer be considered fresh by shared caches.

File

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

Class

Response
Response represents an HTTP response.

Namespace

Symfony\Component\HttpFoundation

Code

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