• We've added extra Spam Protection. if you get problem with account registration / registration rejected. please contact us

Xon's redis cache addon for xenforo 2.x

Nginx

Senior Management
Staff member
Registered
Joined
Feb 27, 2018
Messages
85
Reaction score
245
Points
33
Age
20
Besides above listed native Xenforo 2.x Redis caching, there's alot the awesome Redis Cache Addon developed by Xon which extends the features and capabilities beyond that of native implementation. Xon's Redis Cache Addon differs from Xenforo 2 native Redis cache support:
  • Does not need php-redis extension like native. Centmin Mod already installs php-redis extension anyway for better performance.
  • Supports high-availability redis replication with redis sentinel support.
  • Supports distributing reads over slaves to allow read scaling
  • Integrates with Xon's other redis add-ons including Redis View Counters, Redis Flood Check, and User Activity by Xon
The Xenforo 2.1.0 src/config.php config file. If you have created multiple Redis server instances like above i.e. 127.0.0.1 port 6479 and 6480, you can change ports below for global cache on port 6479 and page cache on port 6480.

Code:
// global cache
$config['cache']['enabled'] = true;
$config['cache']['namespace'] = 'xfaredis';
$config['cache']['provider'] = 'SV\RedisCache\Redis';
$config['cache']['config'] = [
    'host' => '127.0.0.1',
    'port' => 6379,
    'database' => 2,
    'compress_data' => 6,
    'serializer' => 'igbinary',
    'use_lua' => true,
    'read_timeout' => 1,
    'timeout' => 1,
    'lifetimelimit' => 2592000,
    'compress_threshold' => 20480,
    'persistent' => true
];

// session cache
$config['cache']['sessions'] = true;

$config['pageCache']['enabled'] = true;
$config['pageCache']['lifetime'] = 900;
$config['pageCache']['recordSessionActivity'] = true;
$config['cache']['context']['page']['namespace'] = 'xfaredispagecache';
$config['cache']['context']['page']['provider'] = 'SV\RedisCache\Redis';
$config['cache']['context']['page']['config'] = [
    'host' => '127.0.0.1',
    'port' => 6379,
    'database' => 4,
    'compress_data' => 6,
    'serializer' => 'igbinary',
    'use_lua' => true,
    'read_timeout' => 1,
    'timeout' => 1,
    'lifetimelimit' => 2592000,
    'compress_threshold' => 20480,
    'persistent' => true
];
 
Top
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features of our website. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock