Download Redis Cache By Xon FREE
This add-on uses Credis with a custom cache provider for Redis. For best performance, install the php extension: phpredisYou must have a Redis instance installed, this is likely not possible with shared hosting
While XenForo 2 has a redis connector, it requires phpredis. This add-on does not.
Feature overview
- A pure php redis connector
- High availability support
- Exposes redis cache object for use for use by other add-ons
- Implements some minor caching of forum thread counts
- Redirect's XenForo's individual css template caching to hit redis as otherwise it causes unexpected write & deadlocking on the xf_css_cache table
Edit
src/config.php
and add:
Code:
$config['cache']['enabled'] = true;
$config['cache']['sessions'] = true;
$config['cache']['provider'] = 'SV\RedisCache\Redis';
$config['cache']['config'] = [
'server' => '127.0.0.1',
'port' => 6379,
];
@eva2000 has also written an in-depth walkthrough around setting up redis and this add-on:
See "Xon's Redis Cache Addon For Xenforo 2.x" from:
community.centminmod.com
Troubleshooting
Please be aware that Redis is very sensitive to latency in a virtual environment. If repeated connection failures or protocol errors are experienced disable any Redis Persistence options.
Options
By default, forum thread counts are cached. In general, this is observable when moving large number of threads from one forum to another, and the total page counts are wrong.
Redis Statistics
Admincp dash board is extended with basic redis statistics:
Debugger Statistics
Include redis timings when using the _debug=1 view for a page
Read Scaling
With the $config['cache']['config']['load_from_replica'] option, reads can be deferred to a singular replica instance. This takes all the options of 'config' (except the replicaconfig)
See the FAQ for configuration samples.
High availability
The Zend component support primary/replica setups with Redis Sentinel support. It does not support Redis multi-master clustering.
- Additionally, this add-on implement caching of thread counts in a forum.
- Redis Sentinel support for high-availability (see FAQ for details).
Components licenced under; New BSD
- Credis
- XenForo Add-on code
Please create a GitHub Pull request via the "More Information" link.
Contributions
If you appreciate this add-on, please consider a contribution via PayPal. Details will be provide via private conversation.
Please contact me if you wish for different licencing arrangements.