Review main Abandoned

81881[FEATURE] Introduce CacheTagCollector Api

Sascha Nowak CR 0 V 0 Expert +1267 −114 updated 11/24/23, 09:26

Commit message

A new API has been introduced to collect cache tags and their lifetime.
This API is used in the core to collect cache tags from page cache and
content object cache.

The API is implemented as a new PSR15 request attribute :php:`cacheTags`
to remove the dependency from TSFE. This feature make using and testing
in the core and extensions easier as it provides a solid API.

Now every cache tag has a lifetime. The minimum lifetime is calculated
from all given cache tags. API users don't have to deal with it individually.
The default lifetime for a cache tag is 86400 seconds (24 hours).

The current TSFE api is deprecated in favor of the new API as the
current API implementation does not allow to set a lifetime and
extension authors have to workaround it. The TSFE api will be removed
with the next major version.

Related: #102422
Releases: main
Change-Id: Ice7b3b8aba7c4df3e48d3895d6388f5641fdad63

[WIP] Add cache tags and cache tags flushing

Review

  • Code review CR 0
  • Verified V 0

Files 30

Show 10 more files

Review log 811

  1. Sascha Nowak uploaded patch set 1 11/22/23, 21:23

  2. core-ci voted on patch set 1 V -1 11/22/23, 21:28 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/49556

  3. Sascha Nowak uploaded patch set 2 V -1 11/23/23, 09:52

  4. core-ci voted on patch set 2 V -1 11/23/23, 09:58 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/49620

  5. Sascha Nowak uploaded patch set 3 V -1 11/23/23, 14:19

  6. core-ci voted on patch set 3 V -1 11/23/23, 14:25 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/49701

  7. Benjamin Franzke commented on patch set 3 11/23/23, 15:02

    Typo3DbBackend.php:600 Unresolved

    can be injected

    Typo3DbBackend.php:614 Unresolved

    inject

    Repository.php:234 Unresolved

    Use addTableToCacheTags here?

    Repository.php:282 Unresolved

    Use addTableToCacheTags here?

    Repository.php:360 Unresolved

    inject via injectEventDispatcher() method and mark property nullable and always call via optional chaining

    CacheService.php:180 Unresolved

    looks wrong in general as pageId cache-tag should already be added by TSFE on its own(?)

    CacheService.php:199 Unresolved

    Maybe not needed as already tagged in Repository via addTableToCacheTags?

    CacheLifetimeCalculator.php:77 Unresolved

    as you said in personal discussion: This piece might be backported as bugfix

    ContentContentObject.php:170 Unresolved

    would be nice to be TSFE config agnostic. E.g. handle things like clearCacheAtMidnight in a central place (middleware?) in order to limit maximum cache tag lifetime in a central place.
  8. Sascha Nowak uploaded patch set 4 V -1 11/24/23, 08:33

  9. Sascha Nowak uploaded patch set 5 11/24/23, 09:19

  10. Sascha Nowak uploaded patch set 6 11/24/23, 09:22

  11. Sascha Nowak abandoned the change 11/24/23, 09:26