单一缓存机制配置
return [
'type' => 'Redis',
'host' => '127.0.0.1',
'port' => '6379',
'password' => '',
'timeout' => 3600
];
多层并存缓存机制配置
'cache' => [
// 选择模式
'type' => 'complex',
// 默认(文件缓存)
'default' => [
// 文件缓存
'type' => 'File',
// 缓存保存目录
'path' => CACHE_PATH,
// 缓存前缀
'prefix' => '',
// 缓存有效期 0表示永久缓存
'expire' => 0,
],
// Redis缓存
'redis' => [
'type' => 'Redis',
'host' => '127.0.0.1',
'port' => '6379',
'password' => '123456',
'timeout' => 3600
]
],