src/Util/Caching/CachingHeaders.php
public function addCachingHeaders($numberOfMinutes = 60, $mustRevalidate = true) {

        // Add cache control header if revalidate
        $numberOfSeconds = $numberOfMinutes * 60;
        $header = "Cache-Control: public, max-age=" . ($numberOfSeconds);
        if ($mustRevalidate)
            $header .= ", must-revalidate";

        header($header);

        // Add the Expires header.
        $expStr = "Expires: " . gmdate("D, d M Y H:i:s", time() + $numberOfSeconds) . " GMT";
        header($expStr);

        // Add the last modified header.
        $lastModified = "Last-Modified: " . gmdate("D, d M Y H:i:s", time()) . " GMT";
        header($lastModified);

        header_remove("Pragma");

        $etag = '"' . filemtime(__FILE__) . '.' . date("U") . '"';
        header("ETag: $etag");


    }
public function addCachingHeaders($numberOfMinutes = 60, $mustRevalidate = true) {

        // Add cache control header if revalidate
        $numberOfSeconds = $numberOfMinutes * 60;
        $header = "Cache-Control: public, max-age=" . ($numberOfSeconds);
        if ($mustRevalidate)
            $header .= ", must-revalidate";

        header($header);

        // Add the Expires header.
        $expStr = "Expires: " . gmdate("D, d M Y H:i:s", time() + $numberOfSeconds) . " GMT";
        header($expStr);

        // Add the last modified header.
        $lastModified = "Last-Modified: " . gmdate("D, d M Y H:i:s", time()) . " GMT";
        header($lastModified);

        header_remove("Pragma");

        $etag = '"' . filemtime(__FILE__) . '.' . date("U") . '"';
        header("ETag: $etag");


    }
public function addCachingHeaders ( $ numberOfMinutes = 60 , $ mustRevalidate = true ) { // Add cache control header if revalidate $ numberOfSeconds = $ numberOfMinutes * 60 ; $ header = "Cache-Control: public, max-age=" . ( $ numberOfSeconds ) ; if ( $ mustRevalidate ) $ header .= ", must-revalidate" ; header ( $ header ) ; // Add the Expires header. $ expStr = "Expires: " . gmdate ( "D, d M Y H:i:s" , time ( ) + $ numberOfSeconds ) . " GMT" ; header ( $ expStr ) ; // Add the last modified header. $ lastModified = "Last-Modified: " . gmdate ( "D, d M Y H:i:s" , time ( ) ) . " GMT" ; header ( $ lastModified ) ; header_remove ( "Pragma" ) ; $ etag = '"' . filemtime ( __FILE__ ) . '.' . date ( "U" ) . '"' ; header ( "ETag: $etag" ) ; }
Add caching headers to the current request.
Add caching headers to the current request .