-
Sascha Nowak authored
A new API has been introduced to collect cache tags and their lifetime during frontend rendering. 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 PSR-7 request attribute `frontend.cache.collector` to remove the dependency from TSFE. 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. The frontend employs the following strategy: A relatively early middleware adds an empty new cacheDataCollector instance as attribute to request. Extensions rendering code based on database records can then add cache tags to this attribute. The FE rendering adds the final cache content, the middleware then compiles the final cache entries and triggers their persistence. There is an additional event `AddCacheTagEvent` the middleware listens to. It allows adding cache tags at places where the request is not available. This is a tribute to technical debt that can not be avoided at the moment. That event is however marked `@internal` and may vanish later. Resolves: #102422 Releases: main Change-Id: Ice7b3b8aba7c4df3e48d3895d6388f5641fdad63 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/81801 Tested-by:
Torben Hansen <derhansen@gmail.com> Tested-by:
Benjamin Franzke <ben@bnf.dev> Reviewed-by:
Stefan Bürk <stefan@buerk.tech> Reviewed-by:
Benjamin Franzke <ben@bnf.dev> Reviewed-by:
Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by:
Torben Hansen <derhansen@gmail.com> Tested-by:
Stefan Bürk <stefan@buerk.tech> Tested-by:
Guido Schmechel <guido.schmechel@brandung.de> Tested-by:
Christian Kuhn <lolli@schwarzbu.ch> Tested-by:
core-ci <typo3@b13.com> Reviewed-by:
Guido Schmechel <guido.schmechel@brandung.de> Reviewed-by:
Benni Mack <benni@typo3.org> Tested-by:
Sascha Nowak <typo3@saschanowak.me> Reviewed-by:
Sascha Nowak <typo3@saschanowak.me>
48d0bce0