Skip to content

Redis caches not cleared if cache flush in backend #6

@heural

Description

@heural

If the cache-flush-buttons in the backend clicked (1) - or enable/disable a element on a page xy (2):

  1. should not the redis (page or all) caches cleared?
  2. should not cleared the page cache for page-id xy

The Class https://github.com/b13/graceful-cache/blob/main/src/Backend/RedisCacheBackend.php has flush-methods for that purpose I think.

Maybe I have miss-configured or not undersatnd completely the cache?

`// Frontend page caches (most accessed, long lifetime)
$redisCaches = [
'pages' => [
'lifetime' => 86400 * 30, // 30 days
'compression' => true, // Enable for large HTML content
],
...
];

$redisDatabaseNumber = 0;
foreach ($redisCaches as $cacheName => $cacheConfig) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][$cacheName] = [
// Use b13/graceful-cache wrapper for resilience
'backend' => \B13\GracefulCache\Backend\RedisCacheBackend::class,
'options' => [
'database' => $redisDatabaseNumber++,
'hostname' => $redisHost,
'port' => $redisPort,
'password' => $redisPassword,
'defaultLifetime' => $cacheConfig['lifetime'],
],
];

// Add compression option if specified
if (isset($cacheConfig['compression']) && $cacheConfig['compression'] === true) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][$cacheName]['options']['compression'] = true;
}
}`

Use TYPO3 v12.4.39

Thank you for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions