src/Controller.php
protected function cacheToday($seconds = null): void
    {
        // 调试模式,不缓存
        if (isDebug()) {
            return;
        }

        // 计算秒数
        if (!$seconds) {
            $left = 24 * 60 * 60 - (time() - strtotime(date('Y-m-d'))) + 60;
        } else {
            $left = $seconds;
        }

        // 输出CDN的缓存头
        header("Cache-Control:max-age=" . $left);
        header("Pragma:public");
        header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
        header("Cache-Control: private", false); // required for certain browsers
        header("Expires: " . gmdate("D, d M Y H:i:s", time() + 24 * 60 * 60) . " GMT");
        header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    }
protected function cacheToday($seconds = null): void
    {
        // 调试模式,不缓存
        if (isDebug()) {
            return;
        }

        // 计算秒数
        if (!$seconds) {
            $left = 24 * 60 * 60 - (time() - strtotime(date('Y-m-d'))) + 60;
        } else {
            $left = $seconds;
        }

        // 输出CDN的缓存头
        header("Cache-Control:max-age=" . $left);
        header("Pragma:public");
        header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
        header("Cache-Control: private", false); // required for certain browsers
        header("Expires: " . gmdate("D, d M Y H:i:s", time() + 24 * 60 * 60) . " GMT");
        header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    }
缓存,针对CDN
@param string|int $seconds 秒数,如果不提供,自动 到午夜零点1分 00:01