Redis Cache By Xon

Redis Cache By Xon 2.17.2

No permission to download
This add-on isn't anything special for pageCache support
I have a question about this.
So for pageCache we can use 'Redis' as provider instead of SV\RedisCache\Redis
Same goes for Sessions?
Or it doesn't matter...?
 
You can mix and match cache providers. Most of the simple caching this add-on (and other add-ons I've written) depend on the main caching provider being SV\RedisCache\Redis
 
@Xon What would be the optimal configuration for version 2.1 since I come from version 1.5 and this is my old conf. Thanks for response.

PHP:
$config['cache']['enabled'] = true;
$config['cache']['frontend'] = 'Core';
$config['cache']['frontendOptions']['cache_id_prefix'] = 'xffx_';
$config['cache']['backend'] = 'Redis';
$config['cache']['backendOptions'] = array(
       'server' => '127.0.0.1',
       'port' => 6379,
       'database' => 1,
       'connect_retries' => 2,
       'use_lua' => true,
       'compress_data' => 2,
       'read_timeout' => 1,
       'timeout' => 1,
   );
require(XenForo_Application::getInstance()->getConfigDir().'/SV/RedisCache/Installer.php');
 
It takes the same options as in XF2 for the config section (ie backendOptions) it requires a bit of tinkering but you should be able to just copy & past the contents of backendOptions like so;
PHP:
//$config['cache']['sessions'] = true;
$config['cache']['enabled'] = true;
$config['cache']['namespace'] = 'xffx_';
$config['cache']['provider'] = 'SV\RedisCache\Redis';
$config['cache']['config']  = array(
       'server' => '127.0.0.1',
       'port' => 6379,
       'database' => 1,
       'connect_retries' => 2,
       'use_lua' => true,
       'compress_data' => 2,
       'read_timeout' => 1,
       'timeout' => 1,
    );
(don't need the installer line bit any more)

Optimal configuration can be a bit tricky to determine, keeping the same is easy (note; default for use_lua is true now)
 
That isn't possible, and it generally shouldn't be required.

You can do this via the cli with; redis-cli flushall
 
Thank you for inform.

I have one more question.
What about guest page caching feature of xenforo 2 naturally with this add-on? Are they different so is it configurable?
And should i remove the $config['cache']['sessions'] = true; parameter from config ?

@Xon
 
Forgive me the newbie silly question. I am trying to figure out why I should use Redis Cache By Xon opposite to install Redis myself on my VPS. I can't quite figure out what are the advantages. And I couldn't find an explanation or a post that spell this out.
 
What about guest page caching feature of xenforo 2 naturally with this add-on? Are they different so is it configurable?
Guest caching works, but support for it is beyond the scope of this add-on. It is reasonably straight forward to implement as there isn't much to configure.

And should i remove the $config['cache']['sessions'] = true; parameter from config ?
That will cause sessions to be stored in the database, resulting in extra db hits to load & save any session info.

Forgive me the newbie silly question. I am trying to figure out why I should use Redis Cache By Xon opposite to install Redis myself on my VPS. I can't quite figure out what are the advantages. And I couldn't find an explanation or a post that spell this out.
This add-on is the connector between XenForo and Redis; you still need to install redis.
 
What is right of the cache provider value?

'SV\RedisCache\Redis' or just 'Redis? or are they different ?

Because xenforo cache settings says that configure it as 'Redis' but your add-on says that 'SV\RedisCache\Redis' @Xon

Btw, i'm using css cache, guest page cache and your configuration both.

Thank you for your informations
 
SV\RedisCache\Redis is the provider my add-on adds, it support working without the phpredis extension, and other features which my other redis add-ons use.

Redis is just the XF provided redis adapter.
 
This add-on is the connector between XenForo and Redis; you still need to install redis.

As far as I understand XF has already its connector for Redis, as per its manual. Is there some additional control with this add-on?
 
As far as I understand XF has already its connector for Redis, as per its manual. Is there some additional control with this add-on?
This add-on has an overview page, and a bunch of other add-ons which depend on this add-on.

If you don't need any of the features and don't use any of the add-ons that depend on it; then the stock Redis connector would be sufficient.
 
  • Like
Reactions: ENF
Just to clarify, what should I ask me hosts to instal?

This add-on uses Credis with a custom cache provider for Redis (based off Cm_Cache_Backend_Redis). For best performance, install the php extension: phpredis

You must have a Redis instance installed, this is likely not possible with shared hosting

This is a bit ambiguous. Do I JUST need phpredis installed or is phpredis some sort of extension to Redis and I also need Redis itself installed?
 
You must have redis server installed to use redis caching.

This add-on does not require phpredis extension installed and will operate without it; while the standard XenForo redis connector requires the phpredis extension.
 
@Xon

May i use your redis connector (SV\RedisCache\Redis) instead of standart 'Redis' for css and guest page cache features of Xenforo ?
 
Yes, this redis connector(SV\RedisCache\Redis) can be used where ever XF accepts a caching configuration (ie css & guest page caching).
 
Yes, this redis connector(SV\RedisCache\Redis) can be used where ever XF accepts a caching configuration (ie css & guest page caching).

@Xon Does this correct code for guest page cache features of Xenforo ? Also please let me know that what code need add for caching CSS?

Code:
// START Redis configuration //
$config['cache']['enabled'] = true;
$config['cache']['sessions'] = true;
$config['cache']['namespace'] = 'xfredis_';

$config['cache']['provider'] = 'SV\RedisCache\Redis';
$config['cache']['config'] = array(
'server' => '127.0.0.1',
'port' => 6379,
'connect_retries' => 2,
'use_lua' => true,
'compress_data' => 6,
'read_timeout' => 1,
'timeout' => 1,
'serializer' => 'igbinary',
//        'serializer' => 'php',
'persistent' => true,
);
// END Redis configuration //

// START Guest page caching //
$config['cache']['enabled'] = true;
$config['pageCache']['enabled'] = true;
$config['cache']['context']['page']['provider'] = 'SV\RedisCache\Redis';
$config['cache']['context']['page']['config'] = [];
// END Guest page caching //
 
You need to have the $config['cache']['context']['page']['config'] set; or it'll just use defaults and does not fall back on the global config.

PHP:
$config['cache']['context']['css'] = [
            'namespace' => 'sv',
            'provider' => 'SV\RedisCache\Redis',
            'config' => [
'server' => '127.0.0.1',
'port' => 6380,
            ],
        ];
This will store CSS to a seperate redis instance on port 6380. There is only any point to adding the $config['cache']['context'] if they talk to a different backend
 
Top Bottom