#111082cache:flushtags ignores caches configured in ext_localconf.php
Description
Problem
On TYPO3 14.3 (tested with 14.3.9), vendor/bin/typo3 cache:flushtags <tags> only flushes caches that are part of the base configuration (config/system/settings.php and additional.php). Caches that extensions register or change in their ext_localconf.php are not flushed, with or without --groups.
- EXT:staticfilecache registers its
staticfilecachecache (groupspages,all) inext_localconf.php. Aftercache:flushtags pageId_1the static files and database rows of page 1 are still there, so the outdated page keeps being served. - Extensions that wrap a core cache backend in
ext_localconf.php(for example to react to tag flushes) are bypassed. The flush runs against the unwrapped backend.
The page cache entries themselves (cache_pages) are removed. That’s why it looks as if the command works.
Steps to reproduce
- Install an extension that registers a taggable cache in
ext_localconf.php, e.g.:
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['my_cache'] = [
'backend' => \TYPO3\CMS\Core\Cache\Backend\Typo3DatabaseBackend::class,
'groups' => ['pages'],
];
- Store an entry in
my_cachetaggedtag1. - Run
vendor/bin/typo3 cache:flushtags tag1(or with--groups=pages).
Expected: the entry is removed from my_cache.
*Actual:* the entry remains. A page cache entry tagged tag1 is removed.
Why the fix of #108280 is not enough
- reported that
cache:flushtagsremoved nothing at all, because the command ran in failsafe mode, where the caches areNullBackend. The fix (https://review.typo3.org/c/Packages/TYPO3.CMS/+/91839) takes the CacheManager fromBootService::getContainer(true), ascache:flushdoes. It fixed the caches of the base configuration, which were the ones reported (cache_pages,cache_hash), and its test only covers the corepagescache.
cache:flush does a second thing, though, a few lines further down: it calls BootService::loadExtLocalconfDatabaseAndExtTables(false, true) before it uses the CacheManager. cache:flushtags does not. The command is still registered in EXT:core’s ServiceProvider, so CommandApplication treats it as a low-level command and doesn’t load ext_localconf.php either. ServiceProvider::getCacheManager() then builds the CacheManager from $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'] as it is before any ext_localconf.php has run.
Proposed fix
Load ext_localconf.php in CacheFlushTagsCommand::execute() before fetching the CacheManager, like cache:flush does:
$container = $this->bootService->loadExtLocalconfDatabaseAndExtTables(false, true);
$cacheManager = $container->get(CacheManager::class);
Verified on 14.3.9 with EXT:staticfilecache: with this change, cache:flushtags pageId_X removes the static files and database rows of the page. Without it, they stay.
Affected versions
14.3. In main the command no longer comes from the ServiceProvider. Since #110163 it is a regular #[AsCommand] command with an injected CacheManager, which runs after the full boot, so main is not affected.
Reviews 1
Related issues 1
History 23
-
Felix Buenemann changed Related to #108280 <span data-processor="relativetime" data-value="2026-10-15T14:03:02+00:00" > 10/15/26, 14:03 </span>
-
Gerrit Code Review pushed patch set 1 for 14.3 to change 96727 status
NewUnder Review <span data-processor="relativetime" data-value="2026-10-15T14:19:04+00:00" > 10/15/26, 14:19 </span> -
Anonymous commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-10-30T17:15:17+00:00" > 10/30/26, 17:15 </span>
Applied in changeset commit:c4dc73078550b87107f296aa96965698ac66851a.