• 点击链接加入群聊【XenForo讨论社区】:群号1:143277648
  • 欢迎 游客 您的光临,下载之前请先阅读 积分规则 。任何技术问题请在论坛提问,本站定制插件、模板主题。售前、售后问题请联系QQ:5916171
    本站自由发布资源可赚取积分及人民币(可提现)(保证资源真实可用,如被举报封号处理。谨慎分布)。
Redis Cache

插件 Redis Cache 2.18.0

无购买权限(10G)

Redis Cache

死了算了 首次发布: 最后更新:
语言
英文 (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多主集群。
此外,此附加组件实现了在论坛中缓存线程计数。

最新更新

恢复对XF2.1的支持

恢复对XF2.1的支持

修复bug

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

修复&改进

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

最新评价

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