Files
duolamaojiazhen/config/cache.php
gitfjn f6d50d8d98 城市查询列表
轮播图
首页图标
2025-12-22 21:26:10 +08:00

50 lines
1.5 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
use think\facade\Env;
return [
// 缓存配置为文件类型
'type' => 'complex',
// 默认缓存配置
'default' => [
// 驱动方式
'type' => 'File',
// 缓存保存目录
'path' => '',
// 缓存前缀
'prefix' => 'like_shop_',
// 缓存有效期 0表示永久缓存
'expire' => 0,
],
// Redis缓存配置
'redis' => [
// 驱动方式
'type' => 'redis',
// Redis服务器地址
'host' => Env::get('cache.host','127.0.0.1'),
// Redis服务器端口
'port' => Env::get('cache.port','6379'),
// Redis连接密码留空表示无密码
'password' => Env::get('cache.pwd',''),
// Redis数据库索引0-15默认为0
'select' => Env::get('cache.select', 0),
// 连接超时时间0表示不限制
'timeout' => Env::get('cache.timeout', 0),
// 是否使用长连接true=长连接false=短连接)
'persistent' => Env::get('cache.persistent', true),
// 缓存前缀,用于区分不同应用或环境的缓存
'prefix' => 'like_shop_redis_',
// 缓存有效期0表示永久缓存
'expire' => Env::get('cache.expire', 0),
],
// File缓存配置
'file' => [
'type' => 'File',
'path' => '',
'prefix' => 'like_shop_file_',
'expire' => 0,
],
];