Redis Cache By Xon

Redis Cache By Xon 2.17.2

No permission to download
Sorry, Chrome automatically translated my post before I send this :)

So what I need to run Redis with XF2? I have VPS and I installed redis-server.

Code:
# ls -lh /var/run/redis
-rw-rw---- 1 redis www-data 6 mar 11 23:16 redis-server.pid
srwxrwxr-x 1 redis www-data 0 mar 11 23:16 redis.sock

I added to library/config.php this code:
Code:
$config['cache']['enabled'] = true;
$config['cache']['provider'] = 'SV\RedisCache\Redis';
$config['cache']['config']  = array(
        'server' => 'unix:///var/run/redis/redis.sock',
        'compress_data' => 6,
    );

restarted redis by:
Code:
sudo service redis-server restart

but in admin.php?redis-info/ I still have:

Ok, my mistake. I was editing the old config...
I edit src/config.php and.. now I have error:


but with TCP settings it work's great:
Code:
$config['cache']['enabled'] = true;
$config['cache']['provider'] = 'SV\RedisCache\Redis';
$config['cache']['config']  = array(
        'server' => '127.0.0.1',
        'port' => 6379,
        'compress_data' => 6,
    );
View attachment 170899

phpredis, igbinary also installed:
View attachment 170909

but how to configure this using a socket?

I don't know what's wrong, because in terminal all works like a charm:
Code:
# redis-cli -s /var/run/redis/redis.sock
redis /var/run/redis/redis.sock>
FYI, this ended up being an issue of php-fpm being configured to run the website in a chroot which did not have access to the socket. I've updated the FAQ.
 
I often have the problem that I have to refresh the page and the cache (CTRL + F5) to see changes to the website, strangely only since I installed the addon.
I don't think it has anything to do with it, but does anyone have an idea?
Maybe it's also a setting problem on the redis?
 
Xon, add please files in addons
have you forgotten to create a folder and upload these files there?
/addons/SV/RedisCache/Credis/
Client.php
Cluster.php
Module.php
Sentinel.php
 
Xon, add please files in addons
have you forgotten to create a folder and upload these files there?
/addons/SV/RedisCache/Credis/
Client.php
Cluster.php
Module.php
Sentinel.php
Those files are in the latest 2.1.4 zip, under; upload/src/addons/SV/RedisCache/Credis

You just need to copy the contents 'upload' to your web directory, just like every other of my XF1 or XF2 add-ons.
 
phpredis 4.0.0 is stable. Do you checked out?
i believe phpredis 4.0.0 is for PHP 7.3 which has breaking API changes https://pecl.php.net/package-changelog.php?package=redis&release=4.0.0
*** WARNING! THIS RELEASE CONTAINS BRAKING API CHANGES! ***

* Add proper ARGINFO for all methods. (Pavlo Yatsukhnenko, Michael Grunder)
* Let EXISTS take multiple keys [cccc39] (Michael Grunder)
* Use zend_string as returning value for ra_extract_key and ra_call_extractor [9cd05911] (Pavlo Yatsukhnenko)
* Implement SWAPDB and UNLINK commands [84f1f28b, 9e65c429] (Michael Grunder)
* Return real connection error as exception [5b9c0c60] (Pavlo Yatsukhnenko, Michael Grunder)
* Disallow using empty string as session name. [485db46f] (Pavlo Yatsukhnenko)
* Use zend_string for storing auth and prefix members [4b8336f7] (Pavlo Yatsukhnenko)
* The element of z_seeds may be a reference on php7 [367bc6aa, 1e63717a] (@janic716)
* Avoid connection in helper methods [91e9cfe1] (Pavlo Yatsukhnenko)
* Add tcp_keepalive option to redis sock [68c58513, 5101172a, 010336d5, 51e48729] (@git-hulk, Michael Grunder)
* More robust GEORADIUS COUNT validation [f7edee5d] (Michael Grunder)
* Add LZF compression (experimental) [e2c51251, 8cb2d5bd, 8657557] (Pavlo Yatsukhnenko)
* Allow to use empty string as persistant_id [ec4fd1bd] (Pavlo Yatsukhnenko)
* Don't use convert_to_string in redis_hmget_cmd [99335d6] (Pavlo Yatsukhnenko)
* Allow mixing MULTI and PIPELINE modes (experimental) [5874b0] (Pavlo Yatsukhnenko)
* PHP >=7.3.0 uses zend_string to store `php_url` elements [b566fb44] (@fmk)
* Documentation improvements (Michael Grunder, @TomA-R)
 
phpredis 4.0.0 is stable. Do you checked out?
https://travis-ci.org/colinmollenho..._source=github_status&utm_medium=notification

Nothing looks broken with the version used in this add-on at the moment (only changes are getting unit tests working against latest php, not the php connector code itself)

i believe phpredis 4.0.0 is for PHP 7.3 which has breaking API changes https://pecl.php.net/package-changelog.php?package=redis&release=4.0.0
It has conditional php support, it works form php 5.5 -> php 7.2 and nightly (aka php 7.3)
 
We have a problem with our forum cache. When a user visists a page in the forum before he logs in, goes to another page in the forum, then does a login and then revisistes the first page, he gets the first page as if he wasn't logged in. Normally ctrl+F5 works.
 
This add-on absolutely does not interact with a user's session like that. This sounds like a cached HTML page.
 
This add-on absolutely does not interact with a user's session like that. This sounds like a cached HTML page.
Ok thanks but i really dont know why i have this problem.
in the Ngninx zone cfg i have set it off
Code:
map $sent_http_content_type $expires {
    default                        off;
    text/html                    epoch;
    text/css                    1y;
    text/x-javascript            1M;
    application/javascript        1M;
    application/pdf                7d;
    ~image/                        1y;
 
Last edited:
@Xon I am getting server error log.

Code:
Error: Call to a member function canAddLinks() on null src/addons/XenConcept/AdvancedPermissions/XF/Pub/Controller/Forum.php:43

Generated by: Unknown account Apr 11, 2018 at 11:15 PM

Stack trace

#0 src/XF/Mvc/Dispatcher.php(249): XenConcept\AdvancedPermissions\XF\Pub\Controller\Forum->actionPostThread(Object(XF\Mvc\ParameterBag))
#1 src/XF/Mvc/Dispatcher.php(88): XF\Mvc\Dispatcher->dispatchClass('XF:Forum', 'PostThread', 'html', Object(XF\Mvc\ParameterBag), 'forums', Object(SV\RedisCache\XF\Pub\Controller\Forum), Object(XF\Mvc\Reply\Reroute))
#2 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#3 src/XF/App.php(1891): XF\Mvc\Dispatcher->run()
#4 src/XF.php(328): XF\App->run()
#5 index.php(13): XF::runApp('XF\\Pub\\App')
#6 {main}

Request state

array(4) {
  ["url"] => string(34) "/index.php?forums/85/create-thread"
  ["referrer"] => bool(false)
  ["_GET"] => array(1) {
    ["forums/85/create-thread"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}
 
@Xon I am getting server error log.

Code:
Error: Call to a member function canAddLinks() on null src/addons/XenConcept/AdvancedPermissions/XF/Pub/Controller/Forum.php:43

Generated by: Unknown account Apr 11, 2018 at 11:15 PM

Stack trace

#0 src/XF/Mvc/Dispatcher.php(249): XenConcept\AdvancedPermissions\XF\Pub\Controller\Forum->actionPostThread(Object(XF\Mvc\ParameterBag))
#1 src/XF/Mvc/Dispatcher.php(88): XF\Mvc\Dispatcher->dispatchClass('XF:Forum', 'PostThread', 'html', Object(XF\Mvc\ParameterBag), 'forums', Object(SV\RedisCache\XF\Pub\Controller\Forum), Object(XF\Mvc\Reply\Reroute))
#2 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#3 src/XF/App.php(1891): XF\Mvc\Dispatcher->run()
#4 src/XF.php(328): XF\App->run()
#5 index.php(13): XF::runApp('XF\\Pub\\App')
#6 {main}

Request state

array(4) {
  ["url"] => string(34) "/index.php?forums/85/create-thread"
  ["referrer"] => bool(false)
  ["_GET"] => array(1) {
    ["forums/85/create-thread"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}
This looks to be something Advanced Permissions is doing weird/wrong. canAddLinks() isn't a native function in XenForo
 
Top Bottom