Redis Cache By Xon

Redis Cache By Xon 2.17.2

No permission to download
I did the update. The error has changed as follows

Code:
Fatal error: Uncaught TypeError: Failed to create closure from callable: class 'SV\RedisCache\Redis' does not have a method 'timerForStatDebug' in /home/admin/domains/forum.xxxxxxxxx.com/public_html/src/addons/SV/RedisCache/Redis.php:161 Stack trace: #0 /home/admin/domains/forum.xxxxxxxxx.com/public_html/src/addons/SV/RedisCache/Redis.php(161): Closure::fromCallable(Array) #1 /home/admin/domains/forum.xxxxxxxxx.com/public_html/src/XF/CacheFactory.php(66): SV\RedisCache\Redis->__construct(Array) #2 /home/admin/domains/forum.xxxxxxxxx.com/public_html/src/XF/CacheFactory.php(34): XF\CacheFactory->instantiate('SV\\RedisCache\\R...', Array) #3 /home/admin/domains/forum.xxxxxxxxx.com/public_html/src/XF/App.php(687): XF\CacheFactory->create('SV\\RedisCache\\R...', Array) #4 /home/admin/domains/forum.xxxxxxxxx.com/public_html/src/XF/Container.php(228): XF\App->XF\{closure}('', Array, Object(XF\Container)) #5 /home/admin/domains/forum.xxxxxxxxx.com/public_html/src/XF/App.php(2491): XF\Container->create('cache', '') #6 /home/admin/domains/forum. in /home/admin/domains/forum.xxxxxxxxx.com/public_html/src/addons/SV/RedisCache/Redis.php on line 161

Fatal error: Uncaught TypeError: Failed to create closure from callable: class 'SV\RedisCache\Redis' does not have a method 'timerForStatDebug' in /home/admin/domains/forum.xxxxxxxxx.com/public_html/src/addons/SV/RedisCache/Redis.php:161 Stack trace: #0 /home/admin/domains/forum.xxxxxxxxx.com/public_html/src/addons/SV/RedisCache/Redis.php(161): Closure::fromCallable(Array) #1 /home/admin/domains/forum.xxxxxxxxx.com/public_html/src/XF/CacheFactory.php(66): SV\RedisCache\Redis->__construct(Array) #2 /home/admin/domains/forum.xxxxxxxxx.com/public_html/src/XF/CacheFactory.php(34): XF\CacheFactory->instantiate('SV\\RedisCache\\R...', Array) #3 /home/admin/domains/forum.xxxxxxxxx.com/public_html/src/XF/App.php(687): XF\CacheFactory->create('SV\\RedisCache\\R...', Array) #4 /home/admin/domains/forum.xxxxxxxxx.com/public_html/src/XF/Container.php(228): XF\App->XF\{closure}('', Array, Object(XF\Container)) #5 /home/admin/domains/forum.xxxxxxxxx.com/public_html/src/XF/App.php(2491): XF\Container->create('cache', '') #6 /home/admin/domains/forum. in /home/admin/domains/forum.xxxxxxxxx.com/public_html/src/addons/SV/RedisCache/Redis.php on line 161
 
I leave it on every time I do an import/export of add-ons in my development environment, which I do frequently.
 
When I dos so, I see certain Redis errors at Linux command line when I try:

php cmd.php xf-addon:build-release xxxxx
or
php cmd.php xf-addon:export xxxxx

But it works when I switch at Xenforo 2 config.php Redis off (false). All other cli commands working also with Redis on (true).

I will make some screenshots next time and post them here. :)
 
Found this error today in error.log file of Litespeed.

Code:
[STDERR] PHP Fatal error:  Uncaught CredisException: Connection to Redis 127.0.0.1:6379 failed after 3 failures.Last Error : (1) Connection refused in /home/mysite.com/public_html/src/addons/SV/RedisCache/Credis/Client.php:497
Stack trace:
#0 /home/mysite.com/public_html/src/addons/SV/RedisCache/Credis/Client.php(493): Credis_Client->connect()
#1 /home/mysite.com/public_html/src/addons/SV/RedisCache/Credis/Client.php(493): Credis_Client->connect()
#2 /home/mysite.com/public_html/src/addons/SV/RedisCache/Credis/Client.php(815): Credis_Client->connect()
#3 /home/mysite.com/public_html/src/addons/SV/RedisCache/Credis/Client.php(648): Credis_Client->__call('auth', Array)
#4 /home/mysite.com/public_html/src/addons/SV/RedisCache/Cm_Cache_Backend_Redis.php(435): Credis_Client->auth('KFGO3jgoHBGQkgN...')
#5 /home/mysite.com/public_html/src/addons/SV/RedisCache/Cm_Cache_Backend_Redis.php(258): SV\RedisCache\Cm_Cache_Backend_Redis->_applyClientOptions(Object(Credis_Client))
#6 /home/mysite.com/public_html/src/addo in /home/mysite.com/public_html/src/addons/SV/RedisCache/Credis/Client.php on line 497
 
upgraded to 2.2.5 today
then did a cpanel update which i thought caused things, but looking into it more, seems to be redis related....

brought down my site with:

Code:
[04-May-2021 21:38:03 UTC] PHP Fatal error:  Uncaught TypeError: Argument 1 passed to XF\Extension::__construct() must be of the type array, bool given, called in /home/xxxxx/public_html/src/XF/App.php on line 1582 and defined in /home/xxxxx/public_html/src/XF/Extension.php:12
Stack trace:
#0 /home/xxxxx/public_html/src/XF/App.php(1582): XF\Extension->__construct(false, false)
#1 /home/xxxxx/public_html/src/XF/Container.php(28): XF\App->XF\{closure}(Object(XF\Container))
#2 /home/xxxxx/public_html/src/XF/App.php(2820): XF\Container->offsetGet('extension')
#3 /home/xxxxx/public_html/src/XF/App.php(2848): XF\App->extension()
#4 /home/xxxxx/public_html/src/XF/App.php(1097): XF\App->extendClass('XF\\FsMounts')
#5 /home/xxxxx/public_html/src/XF/Container.php(28): XF\App->XF\{closure}(Object(XF\Container))
#6 /home/xxxxx/public_html/src/XF/App.php(2577): XF\Container->offsetGet('fs')
#7 /home/xxxxx/public_html/src/XF.php(908): XF\App->fs()
#8 /home/xxxxx/public_html/src/XF/Util/File.php(738): XF::fs()
#9 /home/xxxxx/public_html/src/XF/Error.php(100): XF\Util\ in /home/xxxxx/public_html/src/XF/Extension.php on line 12

turning the cache off in my config fixed it for now. not really sure what's going on here and might not be related at all but wanted to list it here...
 
I seem to have lost the phpredis extension somehow. So, that was part of it... resetting the cache also helped.
 
Just installed.

1622010365090.png

Added the following in src/config.php

CSS:
$config['cache']['enabled'] = true;
$config['cache']['provider'] = 'SV\RedisCache\Redis';
$config['cache']['config']  = array(
        'server' => '127.0.0.1',
        'port' => 6379,
        'compress_data' => 6,
    );

I had the following in /etc/redis.conf

CSS:
save 900 1
save 300 100
save 60 10000

So is that all what I need to do to optimize the usage of this add-on?
 
hello, can this be made to cache post reactions into redis?
Nope.

Just installed.

View attachment 252448

Added the following in src/config.php

CSS:
$config['cache']['enabled'] = true;
$config['cache']['provider'] = 'SV\RedisCache\Redis';
$config['cache']['config']  = array(
        'server' => '127.0.0.1',
        'port' => 6379,
        'compress_data' => 6,
    );

I had the following in /etc/redis.conf

CSS:
save 900 1
save 300 100
save 60 10000

So is that all what I need to do to optimize the usage of this add-on?
That should work, it isn't terribly complex.
 
Mine showing this from admin control panel, but the webhost told me they had installed Redis on my server. What can I do to fix this?
 

Attachments

  • redis disabled.webp
    redis disabled.webp
    4 KB · Views: 20
You need to configure XenForo to use this add-on in the config.php via;
Code:
$config['cache']['enabled'] = true;
$config['cache']['provider'] = 'SV\RedisCache\Redis';
$config['cache']['config']  = [
        'server' => '127.0.0.1',
        'port' => 6379,
];
 
Are there install docs? Not sure what to do with these example config files..
They are simply examples of all the configuration options. I'ld recommend just copy & pasting the snippet from the post above you into your src/config.php file after installing the add-on
 
Automatic AOF rewritings happen every almost an hour. Is that normal behavior?

redis.conf settings:

Code:
#   save ""

# save 900 1
# save 300 10
# save 60 10000

appendonly yes
appendfsync everysec

aof-rewrite-incremental-fsync yes
 
Top Bottom