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

setClientTtl() public method

This method adjusts the Cache-Control/max-age directive.
public setClientTtl ( integer $seconds ) : Response
$seconds integer Number of seconds
return Response
    public function setClientTtl($seconds)
    {
        $this->setMaxAge($this->getAge() + $seconds);

        return $this;
    }

Usage Example

Exemplo n.º 1
0
 public function indexAction()
 {
     $response = new Response($this->dumper->dump(), 200, array('Content-Type' => 'application/xml'));
     $response->setPublic();
     $response->setClientTtl($this->httpCache['ttl']);
     return $response;
 }
All Usage Examples Of Symfony\Component\HttpFoundation\Response::setClientTtl