public function setCachingHeaders($intervalString = CachableBaseComponent::DEFAULT_MAXAGE)
    {
        $expires = new \DateTime();
        $interval = new \DateInterval($intervalString);
        $maxAge = date_create('@0')->add($interval)->getTimestamp();
        $expires = $expires->add($interval);
        ResponseHeaders::add(ResponseHeaders::HEADER_EXPIRES, gmdate('D, d M Y H:i:s \G\M\T', $expires->getTimestamp()));
        ResponseHeaders::add(ResponseHeaders::HEADER_CACHE_CONTROL, 'max-age=' . $maxAge);
        ResponseHeaders::add(ResponseHeaders::HEADER_PRAGMA, ResponseHeaders::HEADER_PRAGMA_CONTENT_CACHE);
    }
public function setCachingHeaders($intervalString = CachableBaseComponent::DEFAULT_MAXAGE)
    {
        $expires = new \DateTime();
        $interval = new \DateInterval($intervalString);
        $maxAge = date_create('@0')->add($interval)->getTimestamp();
        $expires = $expires->add($interval);
        ResponseHeaders::add(ResponseHeaders::HEADER_EXPIRES, gmdate('D, d M Y H:i:s \G\M\T', $expires->getTimestamp()));
        ResponseHeaders::add(ResponseHeaders::HEADER_CACHE_CONTROL, 'max-age=' . $maxAge);
        ResponseHeaders::add(ResponseHeaders::HEADER_PRAGMA, ResponseHeaders::HEADER_PRAGMA_CONTENT_CACHE);
    }
public function setCachingHeaders ( $ intervalString = CachableBaseComponent :: DEFAULT_MAXAGE ) { $ expires = new \ DateTime ( ) ; $ interval = new \ DateInterval ( $ intervalString ) ; $ maxAge = date_create ( '@0' ) -> add ( $ interval ) -> getTimestamp ( ) ; $ expires = $ expires -> add ( $ interval ) ; ResponseHeaders :: add ( ResponseHeaders :: HEADER_EXPIRES , gmdate ( 'D, d M Y H:i:s \G\M\T' , $ expires -> getTimestamp ( ) ) ) ; ResponseHeaders :: add ( ResponseHeaders :: HEADER_CACHE_CONTROL , 'max-age=' . $ maxAge ) ; ResponseHeaders :: add ( ResponseHeaders :: HEADER_PRAGMA , ResponseHeaders :: HEADER_PRAGMA_CONTENT_CACHE ) ; }
Set the default caching of pages
@param string $intervalString
@throws \Exception
Set the default caching of pages