Symfony\Component\HttpFoundation\Response::setPublic PHP Method

setPublic() public method

It makes the response eligible for serving other clients.
public setPublic ( ) : Response
return Response
    public function setPublic()
    {
        $this->headers->addCacheControlDirective('public');
        $this->headers->removeCacheControlDirective('private');

        return $this;
    }

Usage Example

Exemplo n.º 1
0
 public function testDisableCache()
 {
     // disable cache
     $this->structure->getCacheLifeTime()->willReturn(0);
     $this->response->setPublic()->shouldNotBeCalled();
     $this->response->setMaxAge($this->maxAge)->shouldNotBeCalled();
     $this->response->setSharedMaxAge($this->sharedMaxAge)->shouldNotBeCalled();
     $this->handler->updateResponse($this->response->reveal(), $this->structure->reveal());
 }
All Usage Examples Of Symfony\Component\HttpFoundation\Response::setPublic