• 欢迎 游客 您的光临,下载之前请先阅读 积分规则 。任何技术问题请在论坛提问,本站定制插件、模板主题。售前、售后问题请联系QQ:5916171
    本站自由发布资源可赚取积分及人民币(可提现)(保证资源真实可用,如被举报封号处理。谨慎分布)。
  • 即日起发表主题、回帖、发布&更新资源、创建&回复私信、发布&回复个人动态均需要验证手机号码,其它不受影响。如不便可进群提问。点击链接加入群聊【XenForo讨论社区】:群号1:143277648
Redis Cache

插件 Redis Cache 2.17.2

没有购买权限 (10G)
语言
英文 (English)
此插件使用 Credis 与自定义缓存提供程序进行 Redis (基于 Cm_Cache_Backend_Redis)。为获得最佳性能,请安装php扩展:phpredis

故障排除

请注意,Redis对虚拟环境中的延迟非常敏感。如果遇到重复的连接失败或协议错误,请禁用所有Redis Persistence选项。

congfig配置

PHP:
$config['cache']['enabled'] = true;
$config['cache']['sessions'] = true;
$config['cache']['namespace'] = 'xf_';
$config['cache']['provider'] = 'SV\RedisCache\Redis';
$config['cache']['config']  = array(
        'server' => '127.0.0.1',
        'port' => 6379,
        'connect_retries' => 2,
        'compress_data' => 6,
        'use_lua' => true,
        'serializer' => 'igbinary'
    );

或者
PHP:
$config['cache']['enabled'] = true;
$config['cache']['namespace'] = 'xf_';
$config['cache']['sessions'] = true;
$config['cache']['config'] = [
    'host' => '127.0.0.1'
];
$config['cache']['provider'] = function(array $config)
{
    if (!class_exists('Redis'))
    {
        throw new \LogicException("Cannot load Redis cache provider without Redis");
    }

    $config = array_replace([
        'host' => '',
        'port' => 6379,
        'timeout' => 0.0,
        'password' => '',
        'database' => 0,
        'persistent' => false,
        'persistent_id' => ''
    ], $config);

    $r = new \Redis();

    if ($config['persistent'])
    {
        $r->pconnect($config['host'], $config['port'], $config['timeout'], $config['persistent_id']);
    }
    else
    {
        $r->connect($config['host'], $config['port'], $config['timeout']);
    }

    if ($config['password'])
    {
        $r->auth($config['password']);
    }

    if ($config['database'])
    {
        $r->select($config['database']);
    }

    $cache = new \Doctrine\Common\Cache\RedisCache();
    $cache->setRedis($r);
    return $cache;
};

高效

Zend组件支持Redis Sentinel支持的主/从设置。 它不支持Redis多主集群。
此外,此附加组件实现了在论坛中缓存线程计数。
作者
死了算了
价格
10G
下载
76
查看
2,535
首次发布
最后更新
评分
4.67 星 3 星

来自死了算了的更多资源

分享资源

最新更新

  1. 修复bug

    修复了高可用性支持,其中css更新将发送到可能的只读副本而不是可写实例
  2. 修复&改进

    $config['svForce404OnEmptyCss'] = true; Disable behavior which caused css.php to return a 404...
  3. 修复bug

    在admincp redis状态信息块中显示最大内存和最大内存策略,以进行故障排除

最新评论

非常好
不知道为什么我报错了,而且一直搞不好
看了老大的这个回答弄好了https://www.cnxfans.com/threads/php.495/
后退
顶部 底部