public function Response::setPublic

Marks the response as "public".

It makes the response eligible for serving other clients.

@api

Return value

Response

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

File

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

Class

Response
Response represents an HTTP response.

Namespace

Symfony\Component\HttpFoundation

Code

public function setPublic() {
  $this->headers
    ->addCacheControlDirective('public');
  $this->headers
    ->removeCacheControlDirective('private');
  return $this;
}