public function Response::setPublic

Marks the response as "public".

It makes the response eligible for serving other clients.

@api

Return value

Response

2 calls to Response::setPublic()
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 541

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;
}