Issue Bug Resolved

#111082cache:flushtags ignores caches configured in ext_localconf.php

Felix Buenemann 10/15/26, 14:01 updated 10/30/26, 17:15

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.

Examples:
  • EXT:staticfilecache registers its staticfilecache cache (groups pages, all) in ext_localconf.php. After cache:flushtags pageId_1 the 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

  1. 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'],
];
  1. Store an entry in my_cache tagged tag1.
  2. 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

  1. reported that cache:flushtags removed nothing at all, because the command ran in failsafe mode, where the caches are NullBackend. The fix (https://review.typo3.org/c/Packages/TYPO3.CMS/+/91839) takes the CacheManager from BootService::getContainer(true), as cache:flush does. It fixed the caches of the base configuration, which were the ones reported (cache_pages, cache_hash), and its test only covers the core pages cache.

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

History 23

  1. Anonymous commented and changed status Under Review Resolved done 0 % 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.