src/Leevel/Cache/Cache.php
public function remember(string $name, $data, array $option = [])
    {
        if (false !== ($result = $this->connect->get($name, false, $option))) {
            return $result;
        }

        if (is_object($data) && $data instanceof Closure) {
            $data = $data($name);
        }

        $this->connect->set($name, $data, $option);

        return $data;
    }
public function remember(string $name, $data, array $option = [])
    {
        if (false !== ($result = $this->connect->get($name, false, $option))) {
            return $result;
        }

        if (is_object($data) && $data instanceof Closure) {
            $data = $data($name);
        }

        $this->connect->set($name, $data, $option);

        return $data;
    }
缓存存在读取否则重新设置.

@param string $name
@param mixed  $data
@param array  $option

@return mixed