itzbund / gsb-valkey
GSB valkey. The extension provides Redis Sentinel based implementations of existing TYPO3 (core or extensions) implementations for Redis based caching, locking or session storage. This is Part of the Goverment Site Build (GSB) 11. Der GSB 11 ist eine Maßnahme der Dienstekonsolidierung Bund (DKB) des
Requires
- php: ^8.2
- typo3/cms-core: ^12.4 || ^13.4
Requires (Dev)
- captainhook/captainhook-phar: ^5.21
- codeception/codeception: *
- codeception/module-asserts: *
- codeception/module-db: *
- doctrine/dbal: ^3.3
- ergebnis/composer-normalize: ^2.28
- friendsofphp/php-cs-fixer: ^3.14
- helmich/typo3-typoscript-lint: 3.3.0
- itzbund/captainhook-hooks: ^1.0
- michielroos/typo3scan: ^1.7
- mockery/mockery: ^1.6
- php-coveralls/php-coveralls: ^2.5
- phpmd/phpmd: ^2.13
- phpstan/extension-installer: ^1.2
- phpstan/phpstan: ^1.10
- phpstan/phpstan-phpunit: ^1.3
- phpstan/phpstan-strict-rules: ^1.5
- phpunit/phpunit: ^10.0
- ramsey/conventional-commits: ^1.5
- saschaegerer/phpstan-typo3: ^1.8
- sbuerk/typo3-cmscomposerinstallers-testingframework-bridge: ^0.1.2
- seld/jsonlint: ^1.9
- squizlabs/php_codesniffer: ^3.7
- ssch/typo3-rector: ^1.1
- symfony/yaml: ^6.1
- typo3/coding-standards: ^0.7 || ^0.8
- typo3/testing-framework: ^8.1
Suggests
- ext-redis: *
This package is auto-updated.
Last update: 2025-09-12 06:26:02 UTC
README
GSB 11 Extension gsb_valkey
About
The extension gsb_valkey
provides a Valkey/Redis sentinel based implementations of existing TYPO3 (core or extensions) implementations for Redis based caching, locking or session storage.
Note: this extension only makes sense if you want to use sentinel. If you don't want to run sentinel you should use the TYPO3 core implmentations and
EXT:b13/distributed_locking
Installation
The best way to install this extension is to start with the GSB Sitepackage Kickstarter extension.
Quick installation without GSB Sitepackage Kickstarter
In a composer-based TYPO3 installation you can install the extension EXT:gsb_valkey
via composer:
composer require itzbund/gsb-valkey
Configuration
Note: when using Redis/Valkey you should use each database for only one purpose.
Locking strategy: SentinelBasedRedisLockingStrategy
To use the SentinelBasedRedisLockingStrategy
you have to configure it as your locking strategy, e.g. in your additional.php
:
$GLOBALS['TYPO3_CONF_VARS']['SYS']['locking']['strategies'][\ITZBund\GsbValkey\Locking\SentinelBasedRedisLockingStrategy::class] = [
'options' => [
'database' => 0, // Redis/Valkey database used
'hostname' => 'redis', // Redis/Valkey host
'persistentConnection' => true,
'password' => 'password', // optional
'port' => 3679, // Redis/Valkey port
'sentinelHost' => 'redis-sentinel-1', // Redis/Valkey sentinel host
'sentinalPassword' => 'password', // optional
'sentinelPort' => 26379, // Redis/Valkey sentinel port
'ttl' => 10,
],
];
For more details take a look at the TYPO3 documentation on locking.
It is configured to use a priority of 100
, which makes it the default locker compared to those provided by the TYPO3 core.
Caching backend: SentinelBasedRedisBackend
To use the SentinelBasedRedisBackend
you have to configure it as a caching backend, e.g. in your additional.php
:
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][$cacheName]['backend'] = \ITZBund\GsbValkey\Cache\Backend\SentinelBasedRedisBackend::class;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][$cacheName]['options'] = [
'database' => 1, // Redis/Valkey database used
'hostname' => 'redis', // Redis/Valkey host
'password' => 'password', // optional
'persistentConnection' => true,
'port' => 3679, // Redis/Valkey port
'sentinelHostname' => 'redis-sentinel-1', // Redis/Valkey sentinel
'sentinalPassword' => 'password' // optional
'sentinelPort' => 26379, // Redis/Valkeyport
];
For more details take a look at the TYPO3 documentation on cache configurations
Usage
Nothing to do.
Contribute
As with TYPO3, we encourage you to join the project by submitting changes. Development of the GSB 11 happens mainly in the GSB 11 TYPO3 extension repositories.
To get started, have a look at our detailed contribution walkthrough.