It makes the response ineligible for serving other clients.
public setPrivate ( ) : |
||
return |
use Symfony\Component\HttpFoundation\Response; $response = new Response('Hello World!'); $response->setPrivate();
use Symfony\Component\HttpFoundation\Response; $response = new Response('Hello World!'); $response->setPrivate(); $response->setMaxAge(60); $response->setSharedMaxAge(0);This example sets the response to be cacheable for 60 seconds, but only for private caches. The setSharedMaxAge method is also called with a value of 0 to prevent the response from being cached by shared caches. The Symfony\Component\HttpFoundation\Response namespace is where the Response class which has the method setPrivate resides.
public setPrivate ( ) : |
||
return |