Bluz\Http\CacheControl::setMaxAge PHP Метод

setMaxAge() публичный Метод

This methods sets the Cache-Control max-age directive.
public setMaxAge ( integer $value ) : void
$value integer Number of seconds
Результат void
    public function setMaxAge($value)
    {
        $this->doSetContainer('max-age', $value);
        $this->updateCacheControlHeader();
    }

Usage Example

Пример #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'));
 }