Neos\Flow\Http\Response::getMaximumAge PHP Method

getMaximumAge() public method

This method returns the value from the "max-age" directive in the Cache-Control header.
public getMaximumAge ( ) : integer
return integer The maximum age in seconds, or NULL if none has been defined
    public function getMaximumAge()
    {
        return $this->headers->getCacheControlDirective('max-age');
    }

Usage Example

 /**
  * RFC 2616 / 14.9.4
  *
  * @test
  */
 public function setAndGetMaximumAgeSetsAndReturnsTheMaxAgeCacheControlDirective()
 {
     $response = new Response();
     $response->setNow(new \DateTime());
     $response->setMaximumAge(60);
     $this->assertEquals('max-age=60', $response->getHeader('Cache-Control'));
     $this->assertSame(60, $response->getMaximumAge());
 }