src/Leevel/Cache/Redis.php
public function set(string $name, $data, array $option = []): void
    {
        $option = $this->normalizeOptions($option);

        if ($option['serialize']) {
            $data = serialize($data);
        }

        $option['expire'] = $this->cacheTime($name, (int) $option['expire']);

        $this->handle->set(
            $this->getCacheName($name), $data,
            $option['expire'] ? (int) $option['expire'] : null
        );
    }
public function set(string $name, $data, array $option = []): void
    {
        $option = $this->normalizeOptions($option);

        if ($option['serialize']) {
            $data = serialize($data);
        }

        $option['expire'] = $this->cacheTime($name, (int) $option['expire']);

        $this->handle->set(
            $this->getCacheName($name), $data,
            $option['expire'] ? (int) $option['expire'] : null
        );
    }
设置缓存.

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