KeyDB is a superset of redis so it should just work, especially if you are just using a single node and not the sentinel/ha stuff
- High avaliability config default change:
- Change default value for
retry_reads_on_primary
config option totrue
as this guards against unexpected replication delays- Remove unexpected differences for XF2.2 and XF2.3 support (only tested on XF2.2)
- When displaying redis version, include the redis varaint type.
- Known variants are keydb & dragonflydb.
- Dragonflydb does not appear to support IO stats at the moment...
- Disable behavior which caused css.php to return a 404 on an invalid template.
For the old behaviour of returning a HTTP 404 response, set this config.php option:
PHP:$config['svForce404OnEmptyCss'] = true;
ErrorException: Deprecated cache provider: SV\RedisCache\Redis
src/XF/Error.php:77
Stack trace
#0 src/XF.php(224): XF\Error->logError('Deprecated cach...', false)
#1 src/XF/CacheFactory.php(135): XF::logError('Deprecated cach...')
#2 src/XF.php(382): XF\CacheFactory->XF\{closure}()
#3 src/XF/Mvc/Dispatcher.php(158): XF::triggerRunOnce(true)
#4 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#5 src/XF/App.php(2588): XF\Mvc\Dispatcher->run()
#6 src/XF.php(532): XF\App->run()
#7 index.php(20): XF::runApp('XF\\Pub\\App')
#8 {main}
Request state
array(4) {
["url"] => string(1) "/"
["referrer"] => bool(false)
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}
What's the best configuration any used in there. Config file
// 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(
'database' => 0,
'server' => '127.0.0.1',
'port' => 6379,
'connect_retries' => 2,
'use_lua' => true,
'compress_data' => 6,
'read_timeout' => 1,
'timeout' => 1,
'serializer' => 'igbinary',
'persistent' => true,
);
// START CSS caching //
$config['cache']['context']['css'] = [
'namespace' => 'sv',
'provider' => 'SV\RedisCache\Redis',
'config' => [
'server' => '127.0.0.1',
'database' => 1,
'port' => 6379,
],
];
// END CSS caching //
$config['pageCache']['enabled'] = true;
$config['pageCache']['recordSessionActivity'] = true;
$config['cache']['context']['page']['namespace'] = 'xfredispagecache_';
$config['cache']['context']['page']['provider'] = 'SV\RedisCache\Redis';
$config['cache']['context']['page']['config'] = array(
'database' => 2,
'server' => '127.0.0.1',
'port' => 6379,
'connect_retries' => 2,
'use_lua' => true,
'compress_data' => 6,
'read_timeout' => 1,
'timeout' => 1,
'serializer' => 'igbinary',
);
// END Redis configuration //
$config['pageCache']['onSetup'] = function (\XF\PageCache $pageCache) {
$pageCache->setCacheIdGenerator(function(\XF\Http\Request $request) {
return \SV\BrowserDetection\CacheHelper::getPageCacheId($request);
});
};
XF is checking a specific class instead of the interface. I'll check if this is expected behavior or if I need to update this add-onI'm testing XF 2.3 and this error popped up:
Code:ErrorException: Deprecated cache provider: SV\RedisCache\Redis src/XF/Error.php:77 Stack trace #0 src/XF.php(224): XF\Error->logError('Deprecated cach...', false) #1 src/XF/CacheFactory.php(135): XF::logError('Deprecated cach...') #2 src/XF.php(382): XF\CacheFactory->XF\{closure}() #3 src/XF/Mvc/Dispatcher.php(158): XF::triggerRunOnce(true) #4 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch)) #5 src/XF/App.php(2588): XF\Mvc\Dispatcher->run() #6 src/XF.php(532): XF\App->run() #7 index.php(20): XF::runApp('XF\\Pub\\App') #8 {main} Request state array(4) { ["url"] => string(1) "/" ["referrer"] => bool(false) ["_GET"] => array(0) { } ["_POST"] => array(0) { } }
I've created a bug report already:Want me to submit a bug report?
XF\CacheFactory
checks if the provider inherits from \Symfony\Component\Cache\Adapter\AbstractAdapter
instead of Symfony\Component\Cache\Adapter\AdapterInterface
.Doctrine\Common\Cache\CacheProvider
only expects a AdapterInterface
too.
- XF2.3 compatibility update
- A bug in XenForo 2.3 Beta 1 (Fixed in beta 2) prevents XenForo from using this as a caching backend without manual code patching references to
Adapter\AbstractAdapter
toAdapter\AdapterInterface
- Add
\SV\RedisCache\Repository\Redis::get()->getRedisConnector()
method, this should be used instead of\XF::app()->cache() instanceof Redis
or similar.
Error: Call to undefined method Doctrine\Common\Cache\CacheProvider::getNamespacedId()
src/addons/SV/RedisCache/XF/CssRenderer.php:112
Generated by: Unknown account
Mar 26, 2024 at 4:48 PM
Stack trace
#0 src/XF/CssRenderer.php(115): SV\RedisCache\XF\CssRenderer->getFinalCachedOutput(Array)
#1 src/XF/CssWriter.php(60): XF\CssRenderer->render(Array)
#2 src/addons/SV/RedisCache/XF/CssWriter.php(68): XF\CssWriter->run(Array, 0, 3, '0bea92c43c4ab49...')
#3 css.php(30): SV\RedisCache\XF\CssWriter->run(Array, 0, 3, '0bea92c43c4ab49...')
#4 {main}
Request state
array(4) {
["url"] => string(96) "/css.php?css=public%3Aextra.less&s=0&l=3&d=1711468039&k=0bea92c43c4ab499e903ba0963cccc45795a41ff"
["referrer"] => string(55) "https://domain.tld/admin.php?logs/server-errors/"
["_GET"] => array(5) {
["css"] => string(17) "public:extra.less"
["s"] => string(1) "0"
["l"] => string(1) "3"
["d"] => string(10) "1711468039"
["k"] => string(40) "0bea92c43c4ab499e903ba0963cccc45795a41ff"
}
["_POST"] => array(0) {
}
}
- Fix XF2.3 compatibility when css caching is enabled
Fix high availability support where css updates would be sent to a possible readonly replica instead of the writable instance
An unexpected error occurred. Please try again later.
Fatal error: Uncaught ErrorException: [E_WARNING] include(/var/www/[redacted]/public/src/vendor/composer/../../../src/vendor-patch/Doctrine/Common/Cache/CacheProvider.php): Failed to open stream: No such file or directory in /var/www/[redacted]/public/src/vendor/composer/ClassLoader.php:576 Stack trace: #0 /var/www/[redacted]/public/src/vendor/composer/ClassLoader.php(576): XF::handlePhpError(2, '...', '...', 576) #1 /var/www/[redacted]/public/src/vendor/composer/ClassLoader.php(576): include() #2 /var/www/[redacted]/public/src/vendor/composer/ClassLoader.php(427): Composer\Autoload\{closure}('...') #3 /var/www/[redacted]/public/src/addons/SV/RedisCache/DoctrineCache/CacheProvider.php(19): Composer\Autoload\ClassLoader->loadClass('...') #4 /var/www/[redacted]/public/src/vendor/composer/ClassLoader.php(576): include('...') #5 /var/www/[redacted]/public/src/vendor/composer/ClassLoader.php(427): Composer\Autoload\{closure}('...') #6 /var/www/[redacted]/public/src/addons/SV/RedisCache/DoctrineCache/Redis.php(26): Composer\Autoload\ClassLoader->loadClass('...') #7 /var/www/[redacted]/public/src/vendor/composer/ClassLoader.php(576): include('...') #8 /var/www/[redacted]/public/src/vendor/composer/ClassLoader.php(427): Composer\Autoload\{closure}('...') #9 [internal function]: Composer\Autoload\ClassLoader->loadClass('...') #10 /var/www/[redacted]/public/src/addons/SV/RedisCache/Redis.php(11): class_alias('...', '...') #11 /var/www/[redacted]/public/src/vendor/composer/ClassLoader.php(576): include('...') #12 /var/www/[redacted]/public/src/vendor/composer/ClassLoader.php(427): Composer\Autoload\{closure}('...') #13 /var/www/[redacted]/public/src/XF/CacheFactory.php(68): Composer\Autoload\ClassLoader->loadClass('...') #14 /var/www/[redacted]/public/src/XF/CacheFactory.php(36): XF\CacheFactory->instantiate('...', Array) #15 /var/www/[redacted]/public/src/XF/App.php(709): XF\CacheFactory->create('...', Array) #16 /var/www/[redacted]/public/src/XF/Container.php(234): XF\App->XF\{closure}('', Array, Object(XF\Container)) #17 /var/www/[redacted]/public/src/XF/App.php(2661): XF\Container->create('...', '') #18 /var/www/[redacted]/public/src/XF/App.php(736): XF\App->cache('...') #19 /var/www/[redacted]/public/src/XF/Container.php(31): XF\App->XF\{closure}(Object(XF\Container)) #20 /var/www/[redacted]/public/src/XF/App.php(1931): XF\Container->offsetGet('...') #21 /var/www/[redacted]/public/src/XF/Container.php(31): XF\App->XF\{closure}(Object(XF\Container)) #22 /var/www/[redacted]/public/src/XF/App.php(1597): XF\Container->offsetGet('...') #23 /var/www/[redacted]/public/src/XF/Container.php(31): XF\App->XF\{closure}(Object(XF\Container)) #24 /var/www/[redacted]/public/src/XF/App.php(2980): XF\Container->offsetGet('...') #25 /var/www/[redacted]/public/src/XF/App.php(3011): XF\App->extension() #26 /var/www/[redacted]/public/src/XF/App.php(381): XF\App->extendClass('...') #27 /var/www/[redacted]/public/src/XF/Container.php(31): XF\App->XF\{closure}(Object(XF\Container)) #28 /var/www/[redacted]/public/src/XF/App.php(233): XF\Container->offsetGet('...') #29 /var/www/[redacted]/public/src/XF/Container.php(31): XF\App->XF\{closure}(Object(XF\Container)) #30 /var/www/[redacted]/public/src/XF/App.php(2600): XF\Container->offsetGet('...') #31 /var/www/[redacted]/public/src/XF/Error.php(431): XF\App->request() #32 /var/www/[redacted]/public/src/XF/Error.php(385): XF\Error->getExceptionTraceHtml(Object(ErrorException)) #33 /var/www/[redacted]/public/src/XF/App.php(2503): XF\Error->displayFatalExceptionMessage(Object(ErrorException)) #34 /var/www/[redacted]/public/src/XF.php(203): XF\App->displayFatalExceptionMessage(Object(ErrorException)) #35 [internal function]: XF::handleException(Object(ErrorException)) #36 {main} thrown in /var/www/[redacted]/public/src/vendor/composer/ClassLoader.php on line 576
// START Redis configuration //
// Global Cache
$config['cache']['enabled'] = true;
$config['cache']['sessions'] = true;
$config['cache']['namespace'] = 'xfredis_';
$config['cache']['provider'] = \SV\RedisCache\Redis::class;
$config['cache']['config'] = array(
'server' => 'unix:///var/run/redis/redis.sock',
'port' => 6379
);
We use essential cookies to make this site work, and optional cookies to enhance your experience.