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;
    }