- If decompression of fetched content fails, just fail the cache get request. This should be a safe trade-off as if the key returns nothing XF stack should regenerate it.
- Makes changing compression type a cache flush rather than rendering the site useless until Redis is manually flushed.
- Tweak execution order of class extensions/template modifications/etc to provide predictable ordering
- Add LICENCE and README.MD to redistributable.
Yes, you need to ensure you setup the 'server' property to point to the hostname or IP. And firewalls are permitting the connectioni have an external redis server, does the addon work with it?
I cant use the 'server'property
If i change host to server, here my config
i get this error:PHP:$ $config['cache']['config'] = array( 'host' => 'ip', 'port' => 6379, 'password' => 'pw', 'timeout' => 2.5, 'persistent' => null, 'force_standalone' => false, 'connect_retries' => 1, 'read_timeout' => null, 'database' => 0, 'compress_data' => 1, 'lifetimelimit' => 2592000, 'compress_threshold' => 20480, 'compression_lib' => null, // dynamically select first of; snappy,lzf,l4z,gzip IF EMPTY/null 'use_lua' => false, 'serializer' => 'igbinary', // to disable set ot 'php' );
Code:AH01071: Got error 'PHP message: PHP Fatal error: Uncaught ErrorException: [E_WARNING] Redis::connect(): php_network_getaddresses: getaddrinfo failed: Name or service not known in webpath/src/XF/CacheFactory.php:219 Stack trace: #0 [internal function]: XF::handlePhpError(2, '[E_WARNING] Red...', '/var/www/vhosts...', 219, Array) #1 webpath/src/XF/CacheFactory.php(219): Redis->connect('', 6379, 0) #2 webpath/src/XF/CacheFactory.php(69): XF\\CacheFactory->createRedisCache(Array) #3 webpath/src/XF/CacheFactory.php(24): XF\\CacheFactory->instantiate('Redis', Array) #4 webpath/src/XF/App.php(472): XF\\CacheFactory->create('Redis', Array) #5 webpath/src/XF/Container.p... '
'host' => 'ip',
'server' => '127.0.0.1',
Sorry my misstake havent changeThis bit is wrong:'host' => 'ip',
It needs to be;'server' => '127.0.0.1',
Replace 127.0.0.1 with whatever your redis's server's ip is.
$config['cache']['provider'] = 'Redis';
to $config['cache']['provider'] = 'SV\RedisCache\Redis';
Yes, it is possible, use this stanza in $config['cache']['config'] configuration block;@Xon , do you know does this add-on work when using a socket instead of an ip for your Redis? My host uses a socket instead like this:
/home/pathtoyoursocket.sock
There is no password.
'server' => 'unix:///home/pathtoyoursocket.sock',
CredisException: read error on connection src/addons/SV/RedisCache/Credis/Client.php:1157
Generated by: Unknown account Mar 9, 2018 at 8:30 PM
Stack trace
#0 src/addons/SV/RedisCache/Redis.php(226): Credis_Client->__call('get', Array)
#1 src/addons/SV/RedisCache/CacheProvider.php(46): SV\RedisCache\Redis->doFetch('xfredis__sessio...')
#2 src/XF/Session/CacheStorage.php(24): SV\RedisCache\CacheProvider->fetch('session_PZnyUZL...')
#3 src/XF/Session/Session.php(53): XF\Session\CacheStorage->getSession('PZnyUZLYROBORU0...')
#4 src/XF/App.php(632): XF\Session\Session->start('\xB60K\xCA')
#5 src/XF/Container.php(28): XF\App->XF\{closure}(Object(XF\Container))
#6 src/XF/Pub/App.php(39): XF\Container->offsetGet('session.public')
#7 src/XF/Container.php(28): XF\Pub\App->XF\Pub\{closure}(Object(XF\Container))
#8 src/XF/App.php(2208): XF\Container->offsetGet('session')
#9 src/XF/Pub/App.php(91): XF\App->session()
#10 src/XF/App.php(1885): XF\Pub\App->start(true)
#11 src/XF.php(328): XF\App->run()
#12 index.php(13): XF::runApp('XF\\Pub\\App')
#13 {main}
-------------
Previous RedisException: read error on connection - src/addons/SV/RedisCache/Credis/Client.php:1139
#0 src/addons/SV/RedisCache/Credis/Client.php(1139): Redis->get('xfredis__sessio...')
#1 src/addons/SV/RedisCache/Redis.php(226): Credis_Client->__call('get', Array)
#2 src/addons/SV/RedisCache/CacheProvider.php(46): SV\RedisCache\Redis->doFetch('xfredis__sessio...')
#3 src/XF/Session/CacheStorage.php(24): SV\RedisCache\CacheProvider->fetch('session_PZnyUZL...')
#4 src/XF/Session/Session.php(53): XF\Session\CacheStorage->getSession('PZnyUZLYROBORU0...')
#5 src/XF/App.php(632): XF\Session\Session->start('\xB60K\xCA')
#6 src/XF/Container.php(28): XF\App->XF\{closure}(Object(XF\Container))
#7 src/XF/Pub/App.php(39): XF\Container->offsetGet('session.public')
#8 src/XF/Container.php(28): XF\Pub\App->XF\Pub\{closure}(Object(XF\Container))
#9 src/XF/App.php(2208): XF\Container->offsetGet('session')
#10 src/XF/Pub/App.php(91): XF\App->session()
#11 src/XF/App.php(1885): XF\Pub\App->start(true)
#12 src/XF.php(328): XF\App->run()
#13 index.php(13): XF::runApp('XF\\Pub\\App')
#14 {main}
Request state
array(4) {
["url"] => string(38) "/index.php?dbtech-security/fingerprint"
["referrer"] => string(34) "/login/login"
["_GET"] => array(1) {
["dbtech-security/fingerprint"] => string(0) ""
}
["_POST"] => array(6) {
["fingerprint"] => string(32) "be8ad4b55ad69f5588688ef672bd82db"
["components"] => array(23) {
[0] => array(2) {
["key"] => string(10) "user_agent"
["value"] => string(78) "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0"
}
[1] => array(2) {
["key"] => string(8) "language"
["value"] => string(5) "en-US"
}
[2] => array(2) {
["key"] => string(11) "color_depth"
["value"] => string(2) "24"
}
[3] => array(2) {
["key"] => string(11) "pixel_ratio"
["value"] => string(3) "1.5"
}
[4] => array(2) {
["key"] => string(20) "hardware_concurrency"
["value"] => string(1) "8"
}
[5] => array(2) {
["key"] => string(10) "resolution"
["value"] => array(2) {
[0] => string(4) "1280"
[1] => string(3) "720"
}
}
[6] => array(2) {
["key"] => string(20) "available_resolution"
["value"] => array(2) {
[0] => string(4) "1280"
[1] => string(3) "680"
}
}
[7] => array(2) {
["key"] => string(15) "timezone_offset"
["value"] => string(4) "-360"
}
[8] => array(2) {
["key"] => string(15) "session_storage"
["value"] => string(1) "1"
}
[9] => array(2) {
["key"] => string(13) "local_storage"
["value"] => string(1) "1"
}
[10] => array(2) {
["key"] => string(10) "indexed_db"
["value"] => string(1) "1"
}
[11] => array(2) {
["key"] => string(9) "cpu_class"
["value"] => string(7) "unknown"
}
[12] => array(2) {
["key"] => string(18) "navigator_platform"
["value"] => string(5) "Win64"
}
[13] => array(2) {
["key"] => string(12) "do_not_track"
["value"] => string(11) "unspecified"
}
[14] => array(1) {
["key"] => string(15) "regular_plugins"
}
[15] => array(2) {
["key"] => string(6) "canvas"
["value"] => string(17035)
"canvas winding:yes~canvas fp:data:image/png;base64,
[16] => array(2) {
["key"] => string(5) "webgl"
["value"] => string(9281) "data:image/png;base64,
[17] => array(2) {
["key"] => string(7) "adblock"
["value"] => string(4) "true"
}
[18] => array(2) {
["key"] => string(18) "has_lied_languages"
["value"] => string(5) "false"
}
[19] => array(2) {
["key"] => string(19) "has_lied_resolution"
["value"] => string(5) "false"
}
[20] => array(2) {
["key"] => string(11) "has_lied_os"
["value"] => string(5) "false"
}
[21] => array(2) {
["key"] => string(16) "has_lied_browser"
["value"] => string(5) "false"
}
[22] => array(2) {
["key"] => string(13) "touch_support"
["value"] => array(3) {
[0] => string(1) "0"
[1] => string(5) "false"
[2] => string(5) "false"
}
}
}
["_xfRequestUri"] => string(12) "/login/login"
["_xfWithData"] => string(1) "1"
["_xfToken"] => string(8) "********"
["_xfResponseType"] => string(4) "json"
}
}
Once phpredis v4 is stable, I'll look into it. Just so many other add-ons.Are you adding phpredis v4 support?
I believe this add-on maybe compatible with phpredis v4, but I haven't spotted the API changes and all the automated test in the underlying library pass.Are you adding phpredis v4 support?
# 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
$config['cache']['enabled'] = true;
$config['cache']['provider'] = 'SV\RedisCache\Redis';
$config['cache']['config'] = array(
'server' => 'unix:///var/run/redis/redis.sock',
'compress_data' => 6,
);
sudo service redis-server restart
Redis Information
Redis is disabled.
Fatal error: Uncaught CredisException: Connection to Redis /var/run/redis/redis.sock: failed after 2 failures.Last Error : (2) No such file or directory in /web/src/addons/SV/RedisCache/Credis/Client.php:475 Stack trace: #0 /web/src/addons/SV/RedisCache/Credis/Client.php(471): Credis_Client->connect() #1 /web/src/addons/SV/RedisCache/Credis/Client.php(784): Credis_Client->connect() #2 /web/src/addons/SV/RedisCache/Redis.php(251): Credis_Client->__call('mget', Array) #3 /web/src/addons/SV/RedisCache/CacheProvider.php(60): SV\RedisCache\Redis->doFetchMultiple(Array) #4 /web/src/XF/DataRegistry.php(113): SV\RedisCache\CacheProvider->fetchMultiple(Array) #5 /web/src/XF/DataRegistry.php(81): XF\DataRegistry->readFromCache(Array, Array) #6 /web/src/XF/DataRegistry.php(225): XF\DataRegistry->get(Array) #7 /web/src/XF/App.php(1402): XF\DataRegistry->offsetGet('codeEventListen...') #8 /web/src/XF/Container.php(28): XF\App->XF\{closure}(Object(XF\Container)) #9 /web/src/XF/App.php(1216): XF\Container->offsetGet('extension.liste...' in /web/src/addons/SV/RedisCache/Credis/Client.php on line 475
$config['cache']['enabled'] = true;
$config['cache']['provider'] = 'SV\RedisCache\Redis';
$config['cache']['config'] = array(
'server' => '127.0.0.1',
'port' => 6379,
'compress_data' => 6,
);
# redis-cli -s /var/run/redis/redis.sock
redis /var/run/redis/redis.sock>
We use essential cookies to make this site work, and optional cookies to enhance your experience.