Bluz\Http\CacheControl::getAge PHP Method

getAge() public method

Returns the age of the response
public getAge ( ) : integer
return integer The age of the response in seconds
    public function getAge()
    {
        if ($age = $this->response->getHeader('Age')) {
            return (int) $age;
        }
        return max(time() - date('U'), 0);
    }

Usage Example

Example #1
0
 /**
  * Test Expire
  */
 public function testExpire()
 {
     $this->cacheControl->expire();
     $this->assertEquals(0, $this->cacheControl->getAge());
 }