RedisCache
in package
implements
RequestCacheInterface
Tags
Interfaces, Classes and Traits
- RequestCacheInterface
- Interface CacheInterface
Table of Contents
- $cacheKey : string
- 缓存key
- $compress : bool
- $config : array<string|int, mixed>
- $driver : RedisDriver
- $expireTime : int
- 有效时间
- __construct() : mixed
- 设置缓存key和缓存有效期
- get() : bool|mixed|string
- 返回request的内容
- getConfig() : mixed
- 获取缓存配置
- isValid() : bool
- 检查缓存key是否有效
- set() : void
- 设置request请求
- setConfig() : mixed
- 设置配置
Properties
$cacheKey
缓存key
protected
string
$cacheKey
$compress
protected
bool
$compress
= false
$config
protected
array<string|int, mixed>
$config
$driver
protected
RedisDriver
$driver
$expireTime
有效时间
protected
int
$expireTime
= 3600
Methods
__construct()
设置缓存key和缓存有效期
public
__construct(array<string|int, mixed> $option) : mixed
Parameters
- $option : array<string|int, mixed>
Tags
Return values
mixed —get()
返回request的内容
public
get() : bool|mixed|string
Return values
bool|mixed|string —getConfig()
获取缓存配置
public
getConfig() : mixed
Return values
mixed —isValid()
检查缓存key是否有效
public
isValid() : bool
Return values
bool —set()
设置request请求
public
set(string $value) : void
Parameters
- $value : string
Return values
void —setConfig()
设置配置
public
setConfig([array<string|int, mixed> $config = [] ]) : mixed
Parameters
- $config : array<string|int, mixed> = []