src/Controller/Base.php
protected function setCacheHeaders($lastModified, $file, $hit)
    {
        //  Set some flags
        $this->cdnCacheHeadersSet          = true;
        $this->cdnCacheHeadersLastModified = $lastModified;
        $this->cdnCacheHeadersExpires      = time() + $this->cdnCacheHeadersMaxAge;
        $this->cdnCacheHeadersFile         = $file;
        $this->cdnCacheHeadersHit          = $hit ? 'HIT' : 'MISS';

        // --------------------------------------------------------------------------

        header('Cache-Control: max-age=' . $this->cdnCacheHeadersMaxAge . ', must-revalidate', true);
        header('Last-Modified: ' . date('r', $this->cdnCacheHeadersLastModified), true);
        header('Expires: ' . date('r', $this->cdnCacheHeadersExpires), true);
        header('ETag: "' . md5($this->cdnCacheHeadersFile) . '"', true);
        header('X-CDN-CACHE: ' . $this->cdnCacheHeadersHit, true);
    }
protected function setCacheHeaders($lastModified, $file, $hit)
    {
        //  Set some flags
        $this->cdnCacheHeadersSet          = true;
        $this->cdnCacheHeadersLastModified = $lastModified;
        $this->cdnCacheHeadersExpires      = time() + $this->cdnCacheHeadersMaxAge;
        $this->cdnCacheHeadersFile         = $file;
        $this->cdnCacheHeadersHit          = $hit ? 'HIT' : 'MISS';

        // --------------------------------------------------------------------------

        header('Cache-Control: max-age=' . $this->cdnCacheHeadersMaxAge . ', must-revalidate', true);
        header('Last-Modified: ' . date('r', $this->cdnCacheHeadersLastModified), true);
        header('Expires: ' . date('r', $this->cdnCacheHeadersExpires), true);
        header('ETag: "' . md5($this->cdnCacheHeadersFile) . '"', true);
        header('X-CDN-CACHE: ' . $this->cdnCacheHeadersHit, true);
    }
protected function setCacheHeaders ( $ lastModified , $ file , $ hit ) { //  Set some flags $ this -> cdnCacheHeadersSet = true ; $ this -> cdnCacheHeadersLastModified = $ lastModified ; $ this -> cdnCacheHeadersExpires = time ( ) + $ this -> cdnCacheHeadersMaxAge ; $ this -> cdnCacheHeadersFile = $ file ; $ this -> cdnCacheHeadersHit = $ hit ? 'HIT' : 'MISS' ; // -------------------------------------------------------------------------- header ( 'Cache-Control: max-age=' . $ this -> cdnCacheHeadersMaxAge . ', must-revalidate' , true ) ; header ( 'Last-Modified: ' . date ( 'r' , $ this -> cdnCacheHeadersLastModified ) , true ) ; header ( 'Expires: ' . date ( 'r' , $ this -> cdnCacheHeadersExpires ) , true ) ; header ( 'ETag: "' . md5 ( $ this -> cdnCacheHeadersFile ) . '"' , true ) ; header ( 'X-CDN-CACHE: ' . $ this -> cdnCacheHeadersHit , true ) ; }
Set the cache headers of an object

@param string  $lastModified The last modified date of the file
@param string  $file         The file we're serving
@param boolean $hit          Whether or not the request was a cache hit or not
Set the cache headers of an object