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

setPrivate() public method

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

        return $this;
    }

Usage Example

コード例 #1
0
 public function indexAction(Request $request)
 {
     $response = new Response();
     $response->setPrivate();
     $response->setContent($this->twig->render('www/Index.twig', array()));
     return $response;
 }
All Usage Examples Of Symfony\Component\HttpFoundation\Response::setPrivate