缓存配置

优质
小牛编辑
115浏览
2023-12-01

缓存的配置在configs/cache目录,目前支持三种缓存,文件缓存(FileCache), memcache缓存(MemoCache), redis缓存(RedisCache).

文件缓存的配置在file.config.php, 只有一个参数 "cache_dir", 表示文件缓存的根目录

memcache缓存配置在memo.config.php, 可以添加多个memcache服务器,配置格式如下:

return array(
    //缓存服务器
    'server' => array(
        //Memcahe服务器1, 服务器域名 => 服务器端口
        array('localhost', 11211),
        //Memcache服务器2
        array('www.webssky.com',11211)
    )
);

redis缓存配置在redis.config.php, 只要配置redis服务器的ip和端口就可以了

return array(
    'host' => '127.0.0.1',
    'port' => 6379
);