Issue Bug Rejected

#103127CLI command cache:flush not respecting caches without explicit group set

Robert Kärner 02/15/24, 11:26 updated 11/04/24, 15:26

Description

The CLI command `typo3 cache:flush` does not respect custom defined caches in extensions, unless they explicitly define a cache group in their configuration.

Reviews 1

History 46

  1. Benjamin Franzke commented and changed status Under Review Rejected <span data-processor="relativetime" data-value="2024-10-10T15:59:21+00:00" > 10/10/24, 15:59 </span>

    Can not reproduce, tested with:

    ext_localconf.php

    use TYPO3\CMS\Core\Cache\Frontend\VariableFrontend;
    use TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend;
    
    $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['mycache'] = [
        'frontend' => VariableFrontend::class,
        'backend' => SimpleFileBackend::class,
    ];

    Follow commands reveal that flushing works:

    mkdir typo3temp/var/cache/data/mycache
    touch typo3temp/var/cache/data/mycache/foo
    bin/typo3 cache:flush
    LC_ALL=C ls typo3temp/var/cache/data/mycache/foo
    ls: cannot access 'typo3temp/var/cache/data/mycache/foo': No such file or directory

    Note that the cache-group all is assigned due to default-cache-configuration and will be returned by the CacheManager (if your cache is properly registered in ext_localconf.php). This group is then included in the CacheFlushEvent and will be flushed by the CacheManager flush-event-handler.

  2. Philipp Kitzberger commented <span data-processor="relativetime" data-value="2024-10-11T08:17:42+00:00" > 10/11/24, 08:17 </span>

    I can confirm that Benjamin’s example is working as described.

  3. Gerrit Code Review pushed patch set 2 for main to change 83012 status Needs Feedback Under Review <span data-processor="relativetime" data-value="2024-10-18T13:59:10+00:00" > 10/18/24, 13:59 </span>