缓存配置
config.php
'CACHE' => [
//配置项
],
| 配置项 | 默认值 | 类型 | 说明 |
|---|---|---|---|
| driver | file | string | 缓存驱动,可选值:apcu, file, memcache, memcached, redis, wincache, xcache |
| 配置项 | 默认值 | 类型 | 说明 |
|---|---|---|---|
| expire | 0 | int | 缓存时长(秒);过期下次请求生效;0=不限 |
| prefix | string | 缓存前缀 |
| 配置项 | 默认值 | 类型 | 说明 |
|---|---|---|---|
| path | BS_VAR .'cache/' | string | 缓存路径 |
| expire | 0 | int | 缓存时长(秒);0=不限 |
| prefix | string | 缓存前缀 |
| 配置项 | 默认值 | 类型 | 说明 |
|---|---|---|---|
| compress | false | bool | 是否开启压缩 |
| expire | 0 | int | 缓存时长(秒);0=不限,最大 2592000 |
| prefix | string | 缓存前缀 | |
| server | ['localhost', 11211, true, 1, 1] | array | 服务器池,支持多组服务器(二维数组),5个元素分别表示:
|
| 配置项 | 默认值 | 类型 | 说明 |
|---|---|---|---|
| compress | false | bool | 是否开启压缩 |
| expire | 0 | int | 缓存时长(秒);0=不限,最大 2592000 |
| prefix | string | 缓存前缀 | |
| persist | persist_id | string | 持久化连接ID,所有相同ID的实例共享同一连接 |
| timeout | 0 | int | 连接超时(秒),0=默认 |
| user | string | 连接认证用户 | |
| pass | string | 连接认证密码 | |
| server | ['localhost', 11211, 1] | array | 服务器池,支持多组服务器(二维数组),3个元素分别表示:
|
| option | [] | array | 选项 |
| 配置项 | 默认值 | 类型 | 说明 |
|---|---|---|---|
| server | ['127.0.0.1', 6379, 0] | array | 服务器,4个元素分别表示:
|
| expire | 0 | int | 缓存时长(秒),0=不限 |
| prefix | string | 缓存前缀 | |
| persist | true | bool | 是否持久连接 |
| timeout | 0 | int | 连接超时(秒),0=默认 |
| option | [] | array | 附加选项 |
| 配置项 | 默认值 | 类型 | 说明 |
|---|---|---|---|
| expire | 0 | int | 缓存时长(秒);0=不限 |
| prefix | string | 缓存前缀 |
| 配置项 | 默认值 | 类型 | 说明 |
|---|---|---|---|
| expire | 0 | int | 缓存时长(秒);过期下次请求生效;0=不限 |
| prefix | string | 缓存前缀 |
注意
不支持cfg()动态配置。