ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
框架内置了一个默认的缓存驱动,为名为DefaultFile,是文件缓存。如果需要更换默认缓存驱动,在配置文件中添加配置 ~~~ 'DEFAULT_CACHE' => '自己定义的名称' ~~~ ## memcached ~~~ '自己定义名称' => array( 'type' => 'Memcache', 'option' => array( 'host' => '127.0.0.1', 'port' => 11211, 'timeout' => 1, 'pconnect' => false, ) ), ~~~ ## memcached ~~~ '自己定义名称' => array( 'type' => 'Memcached', 'option' => array( 'host' => '127.0.0.1', 'port' => 11211, 'timeout' => 1, 'pconnect' => false, ) ), ~~~ ## redis ~~~ '自己定义名称' => array( 'type' => 'Redis', 'option' => array( 'host' => '127.0.0.1', 'port' => 6379, 'timeout' => 1, 'pconnect' => false, ) ), ~~~ ## db ~~~ '自己定义名称' => array( 'type' => 'Db', 'option' => array( // 数据库配置别名 'db_alias' => 'default', // 表全名,包括前缀,如果设置将无视table的值 // 'table_name' => 'tb_cache', // 不包括表前缀的表名 'table' => 'cache', ) ), ~~~ ## 其它内置缓存驱动 ~~~ '自己定义名称' => array( 'type' => '驱动名', 'option' => array() ), ~~~ 不需要初始化配置的驱动,option项可以省略或留空哦