public function setHeaders($maxAge)
    {
        $lastModifiedDate = $this->assetType->getLastModifiedDate();
        $eTag = md5($lastModifiedDate . $this->assetType->getContent());
        $checkModifiedSince = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ?
            $_SERVER['HTTP_IF_MODIFIED_SINCE'] : false;
        $checkETag = isset($_SERVER['HTTP_IF_NONE_MATCH']) ?
            $_SERVER['HTTP_IF_NONE_MATCH'] : false;

        if (
            ($checkModifiedSince && strtotime($checkModifiedSince) == $lastModifiedDate) ||
            $checkETag == $eTag
        ) {
            $this->headerController->statusCode('HTTP/1.1', 304, 'Not Modified');
            $this->notModified = true;
        } else {
            // We don't want the browser to handle any cache, Munee will handle that.
            $this->headerController->headerField('Cache-Control', 'max-age=' . $maxAge . ', must-revalidate');
            $this->headerController->headerField('Last-Modified', gmdate('D, d M Y H:i:s', $lastModifiedDate) . ' GMT');
            $this->headerController->headerField('ETag', $eTag);
            $this->assetType->getHeaders();
        }

        return $this;
    }
public function setHeaders($maxAge)
    {
        $lastModifiedDate = $this->assetType->getLastModifiedDate();
        $eTag = md5($lastModifiedDate . $this->assetType->getContent());
        $checkModifiedSince = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ?
            $_SERVER['HTTP_IF_MODIFIED_SINCE'] : false;
        $checkETag = isset($_SERVER['HTTP_IF_NONE_MATCH']) ?
            $_SERVER['HTTP_IF_NONE_MATCH'] : false;

        if (
            ($checkModifiedSince && strtotime($checkModifiedSince) == $lastModifiedDate) ||
            $checkETag == $eTag
        ) {
            $this->headerController->statusCode('HTTP/1.1', 304, 'Not Modified');
            $this->notModified = true;
        } else {
            // We don't want the browser to handle any cache, Munee will handle that.
            $this->headerController->headerField('Cache-Control', 'max-age=' . $maxAge . ', must-revalidate');
            $this->headerController->headerField('Last-Modified', gmdate('D, d M Y H:i:s', $lastModifiedDate) . ' GMT');
            $this->headerController->headerField('ETag', $eTag);
            $this->assetType->getHeaders();
        }

        return $this;
    }
public function setHeaders ( $ maxAge ) { $ lastModifiedDate = $ this -> assetType -> getLastModifiedDate ( ) ; $ eTag = md5 ( $ lastModifiedDate . $ this -> assetType -> getContent ( ) ) ; $ checkModifiedSince = isset ( $ _SERVER [ 'HTTP_IF_MODIFIED_SINCE' ] ) ? $ _SERVER [ 'HTTP_IF_MODIFIED_SINCE' ] : false ; $ checkETag = isset ( $ _SERVER [ 'HTTP_IF_NONE_MATCH' ] ) ? $ _SERVER [ 'HTTP_IF_NONE_MATCH' ] : false ; if ( ( $ checkModifiedSince && strtotime ( $ checkModifiedSince ) == $ lastModifiedDate ) || $ checkETag == $ eTag ) { $ this -> headerController -> statusCode ( 'HTTP/1.1' , 304 , 'Not Modified' ) ; $ this -> notModified = true ; } else { // We don't want the browser to handle any cache, Munee will handle that. $ this -> headerController -> headerField ( 'Cache-Control' , 'max-age=' . $ maxAge . ', must-revalidate' ) ; $ this -> headerController -> headerField ( 'Last-Modified' , gmdate ( 'D, d M Y H:i:s' , $ lastModifiedDate ) . ' GMT' ) ; $ this -> headerController -> headerField ( 'ETag' , $ eTag ) ; $ this -> assetType -> getHeaders ( ) ; } return $ this ; }
Set Headers for Response

@param integer $maxAge - Used with the cache-control to tell the browser how long it should wait before revalidating

@return self

@throws ErrorException
Set Headers for Response