From 432d8da3506c6bcdda88fb4ff90d2b3d9a38baf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Sat, 12 Sep 2026 11:31:29 +0200 Subject: [PATCH] chore: update redis config --- composer.json | 1 + composer.lock | 5 +-- public/typo3conf/AdditionalConfiguration.php | 32 ++++++++++++++++---- 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index d6e511ad..0c075767 100644 --- a/composer.json +++ b/composer.json @@ -15,6 +15,7 @@ "ext-json": "*", "ext-libxml": "*", "ext-pdo": "*", + "ext-redis": "*", "ext-simplexml": "*", "b13/container": "^1.3", "blueways/bw-captcha": "^3.1", diff --git a/composer.lock b/composer.lock index 57fbb626..0cd30448 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e3a433b77a2142f116e57b54c4172ffa", + "content-hash": "38fb94ebf504e8413d37c94f929e4b47", "packages": [ { "name": "b13/container", @@ -9647,11 +9647,12 @@ "ext-json": "*", "ext-libxml": "*", "ext-pdo": "*", + "ext-redis": "*", "ext-simplexml": "*" }, "platform-dev": {}, "platform-overrides": { - "php": "7.4.13" + "php": "7.4.33" }, "plugin-api-version": "2.9.0" } diff --git a/public/typo3conf/AdditionalConfiguration.php b/public/typo3conf/AdditionalConfiguration.php index 74643dd0..03f1447a 100644 --- a/public/typo3conf/AdditionalConfiguration.php +++ b/public/typo3conf/AdditionalConfiguration.php @@ -47,22 +47,42 @@ if (getenv('IS_DDEV_PROJECT') == 'true') { ); } -$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_pages'] = [ +// Fail fast instead of blocking indefinitely when redis is unreachable. +$redisOptions['connectionTimeout'] = 2; + +// Note: the cache identifiers must stay unprefixed ('pages', not 'cache_pages'). These +// assignments replace the definitions from LocalConfiguration.php wholesale, so 'groups' +// and the compression/lifetime options have to be repeated here. +$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['pages'] = [ 'frontend' => \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class, 'backend' => \TYPO3\CMS\Core\Cache\Backend\RedisBackend::class, - 'options' => $redisOptions + ['database' => 0], + 'options' => $redisOptions + [ + 'database' => 0, + 'compression' => true, + ], + 'groups' => ['pages'], ]; -$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_hash'] = [ +$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['hash'] = [ 'frontend' => \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class, 'backend' => \TYPO3\CMS\Core\Cache\Backend\RedisBackend::class, - 'options' => $redisOptions + ['database' => 1], + 'options' => $redisOptions + [ + 'database' => 1, + ], + 'groups' => ['pages'], ]; -$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_rootline'] = [ +// Own database: RedisBackend::flush() issues FLUSHDB and the keys carry no per-cache +// prefix, so two caches sharing a database flush each other. +$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['rootline'] = [ 'frontend' => \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class, 'backend' => \TYPO3\CMS\Core\Cache\Backend\RedisBackend::class, - 'options' => $redisOptions + ['database' => 1], + 'options' => $redisOptions + [ + 'database' => 2, + 'compression' => true, + 'defaultLifetime' => 2592000, + ], + 'groups' => ['pages'], ]; // suppress php deprecation warnings flooding typo3 logs