src/Leevel/Http/Response.php
public function setCache(int $minutes): IResponse
    {
        if ($this->checkFlowControl()) {
            return $this;
        }

        $date = new DateTime();
        $date->modify('+'.$minutes.'minutes');

        $this->setExpires($date);
        $this->setHeader('Cache-Control', 'max-age='.($minutes * 60));

        return $this;
    }
public function setCache(int $minutes): IResponse
    {
        if ($this->checkFlowControl()) {
            return $this;
        }

        $date = new DateTime();
        $date->modify('+'.$minutes.'minutes');

        $this->setExpires($date);
        $this->setHeader('Cache-Control', 'max-age='.($minutes * 60));

        return $this;
    }
设置缓存.

@param int $minutes

@return $this