public static function match($modified, $etag = null)
    {
        $modifiedsince = Request::header('If-Modified-Since');

        if ($modifiedsince &&
            preg_match('#^[a-z]{3}[,] \d{2} [a-z]{3} \d{4} \d{2}[:]\d{2}[:]\d{2} GMT$#i', $modifiedsince) !== 0 &&
            strtotime($modifiedsince) == $modified) {
            return true;
        }

        $nonematch = Request::header('If-None-Match');

        return $nonematch && trim($nonematch) === $etag;
    }
public static function match($modified, $etag = null)
    {
        $modifiedsince = Request::header('If-Modified-Since');

        if ($modifiedsince &&
            preg_match('#^[a-z]{3}[,] \d{2} [a-z]{3} \d{4} \d{2}[:]\d{2}[:]\d{2} GMT$#i', $modifiedsince) !== 0 &&
            strtotime($modifiedsince) == $modified) {
            return true;
        }

        $nonematch = Request::header('If-None-Match');

        return $nonematch && trim($nonematch) === $etag;
    }
public static function match ( $ modified , $ etag = null ) { $ modifiedsince = Request :: header ( 'If-Modified-Since' ) ; if ( $ modifiedsince && preg_match ( '#^[a-z]{3}[,] \d{2} [a-z]{3} \d{4} \d{2}[:]\d{2}[:]\d{2} GMT$#i' , $ modifiedsince ) !== 0 && strtotime ( $ modifiedsince ) == $ modified ) { return true ; } $ nonematch = Request :: header ( 'If-None-Match' ) ; return $ nonematch && trim ( $ nonematch ) === $ etag ; }
Check `HTTP_IF_MODIFIED_SINCE` and `HTTP_IF_NONE_MATCH` from server
If true you can send `304 Not Modified`

@param string $modified
@param string $etag
@return bool
Check HTTP_IF_MODIFIED_SINCE and HTTP_IF_NONE_MATCH from server If true you can send 304 Not Modified