Bluz\Http\CacheControl::setPrivate PHP Method

setPrivate() public method

It makes the response ineligible for serving other clients.
public setPrivate ( ) : void
return void
    public function setPrivate()
    {
        $this->doDeleteContainer('public');
        $this->doSetContainer('private', true);
        $this->updateCacheControlHeader();
    }

Usage Example

Beispiel #1
0
 /**
  * Test CacheControl as private
  */
 public function testCacheControlPrivate()
 {
     $this->cacheControl->setPrivate();
     $this->cacheControl->setMaxAge(3600);
     $this->assertEquals(3600, $this->cacheControl->getMaxAge());
     $this->assertEquals('max-age=3600, private', $this->response->getHeader('Cache-Control'));
 }