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

setSharedMaxAge() public method

This methods sets the Cache-Control s-maxage directive.
public setSharedMaxAge ( integer $value ) : Response
$value integer Number of seconds
return Response
    public function setSharedMaxAge($value)
    {
        $this->setPublic();
        $this->headers->addCacheControlDirective('s-maxage', $value);

        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::setSharedMaxAge