97191[!!!][FEATURE] Flush caches without DataHandler
Commit message
Review
-
Code review CR +2 Done
- Benni Mack +2
- Daniel Windloff +1
- Garvin Hicking +1
-
Verified V +2 Done
- Benni Mack +2
- Daniel Windloff +1
- Garvin Hicking +1
- core-ci +1 CI
Issues 2
Files 43
- typo3/sysext/backend/Classes/Controller/ClearCacheController.php3+21 −11
- typo3/sysext/backend/Tests/Functional/Controller/Fixtures/ClearCacheController/pages.csvnew+4 −0
- typo3/sysext/backend/Tests/Functional/Controller/ClearCacheControllerTest.phpnew+77 −0
- typo3/sysext/core/Classes/Cache/Event/AfterCacheFlushedEvent.php2new+33 −0
- typo3/sysext/core/Classes/Cache/Event/BeforeCacheFlushEvent.phpnew+35 −0
- typo3/sysext/core/Classes/Cache/Event/BeforeRecordRelatedCachesAreFlushedEvent.php3new+125 −0
- typo3/sysext/core/Classes/Cache/Flush/CacheFlushDemand.phpnew+98 −0
- typo3/sysext/core/Classes/Cache/Flush/CacheFlusher.php2new+204 −0
- typo3/sysext/core/Classes/Cache/Flush/CacheFlushingContext.php2new+51 −0
- typo3/sysext/core/Classes/Cache/Flush/CacheFlushLogger.phpnew+53 −0
- typo3/sysext/core/Classes/Cache/Flush/CacheFlushPageResolver.php4new+195 −0
- typo3/sysext/core/Classes/Cache/Flush/CacheFlushPlan.phpnew+154 −0
- typo3/sysext/core/Classes/Cache/Flush/CacheFlushRecord.phpnew+39 −0
- typo3/sysext/core/Classes/Cache/Flush/CacheFlushResult.phpnew+94 −0
- typo3/sysext/core/Classes/Cache/Flush/CacheFlushSkipReason.phpnew+30 −0
- typo3/sysext/core/Classes/Cache/CacheManager.php+18 −1
- typo3/sysext/core/Classes/DataHandling/DataHandler.php4+20 −275
- typo3/sysext/core/Documentation/Changelog/15.0/Breaking-111263-RemovedCacheClearingHooksOfDataHandler.rstnew+86 −0
- typo3/sysext/core/Documentation/Changelog/15.0/Feature-111263-FlushCachesWithoutDataHandler.rstnew+105 −0
- typo3/sysext/core/Tests/Functional/Cache/Flush/Fixtures/FlushCountingBackend.phpnew+31 −0
Show 23 more files
- typo3/sysext/core/Tests/Functional/Cache/Flush/Fixtures/PageTree.csvnew+25 −0
- typo3/sysext/core/Tests/Functional/Cache/Flush/CacheFlusherTest.phpnew+419 −0
- typo3/sysext/core/Tests/Functional/Cache/Flush/DataHandlerCacheFlushTest.phpnew+151 −0
- typo3/sysext/core/Tests/Unit/Cache/CacheManagerTest.php+43 −0
- typo3/sysext/core/Tests/Unit/DataHandling/DataHandlerTest.php+12 −12
- typo3/sysext/frontend/Classes/EventListener/FlushPageCachesOnTemplateChange.phpnew+39 −0
- typo3/sysext/frontend/Tests/Functional/EventListener/Fixtures/FlushPageCachesOnTemplateChange.csvnew+9 −0
- typo3/sysext/frontend/Tests/Functional/EventListener/FlushPageCachesOnTemplateChangeTest.phpnew+52 −0
- typo3/sysext/indexed_search/Classes/EventListener/RemoveIndexedContentOfChangedPages.php4new+59 −0
- typo3/sysext/indexed_search/Classes/Hook/DeleteIndexedData.phpdeleted+0 −49
- typo3/sysext/indexed_search/Configuration/Services.yaml+0 −4
- typo3/sysext/indexed_search/Tests/Functional/EventListener/RemoveIndexedContentOfChangedPagesTest.phpnew+70 −0
- typo3/sysext/indexed_search/Tests/Functional/Fixtures/RemoveIndexedContent/Records.csvnew+16 −0
- typo3/sysext/indexed_search/Tests/Functional/Hook/DeleteIndexedDataTest.phpdeleted+0 −57
- typo3/sysext/indexed_search/ext_localconf.php+0 −2
- typo3/sysext/install/Configuration/ExtensionScanner/Php/ArrayDimensionMatcher.php+12 −0
- typo3/sysext/redirects/Classes/Hooks/DataHandlerCacheFlushingHook.phpdeleted+0 −92
- typo3/sysext/redirects/Classes/Hooks/DataHandlerRedirectCacheHook.phpnew+96 −0
- typo3/sysext/redirects/Tests/Functional/Hooks/Fixtures/RedirectCache/sys_redirect.csvnew+4 −0
- typo3/sysext/redirects/Tests/Functional/Hooks/DataHandlerRedirectCacheHookTest.phpnew+111 −0
- typo3/sysext/redirects/ext_localconf.php+3 −2
- typo3/sysext/tstemplate/Classes/Hooks/DataHandlerClearCachePostProcHook.phpdeleted+0 −46
- typo3/sysext/tstemplate/ext_localconf.phpdeleted+0 −9
Review log 2433
Show 68 earlier messages
-
Benni Mack uploaded patch set 1 10/28/26, 10:09
-
Benni Mack marked it work in progress 10/28/26, 10:10
-
core-ci voted on patch set 1 V -1 10/28/26, 10:25 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112699
-
Benni Mack uploaded patch set 2
V -110/28/26, 16:05 -
core-ci voted on patch set 2 V -1 10/28/26, 16:16 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112738
-
Daniel Windloff commented on patch set 2 10/30/26, 06:08
AfterCacheFlushedEvent.php:24`cache:flush`, `cache:flushtags` commands and `Flush cache` of the install tool don't trigger this event.BeforeRecordRelatedCachesAreFlushedEvent.php:50additionalPageIdsToClearCacheCacheFlushPageResolver.php:43Avoid unnecessary wrapper methodsCacheFlushPageResolver.php:59Why deleted restriction here?CacheFlushRequest.php:55forPageTagsPageByIds to clarify that no further processing is done.CacheFlusher.php:124Check for 0/null before addingCacheFlushingContext.php:26Currently not used in CLIDataHandler.php:8904deprecate method?DataHandler.php:8910Move to a new service as ClearCacheController does the same loggingRemoveIndexedContentOfChangedPages.php:39Check first for isEnabled with early return for false.RemoveIndexedContentOfChangedPages.php:44Use `$this->administrationRepository->removeIndexedPageContent($record->pageId);` to remove the additional `for` loopFlushPageCachesOnTemplateChange.php:28Even if tstemplate is factory default, I would suggest moving this to core as it affects persistance in general.FlushPageCachesOnTemplateChange.php:34Is this assumption correct, that a sys_template may affect any page? I had assumed, that a `sys_template` record can only really affect its own pid and all the child pages of that pid. -
Garvin Hicking commented on patch set 2 10/30/26, 08:30
CacheFlushRequest.php:24We should call this "CacheFlushhDemand" to not maybe confuse this with PSR request context? -
Benni Mack uploaded patch set 3
V -110/30/26, 10:15
-
core-ci voted on patch set 3 V +1 10/30/26, 10:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112846
-
Benni Mack commented on patch set 3 10/30/26, 10:34
ClearCacheController.php:81ReplyI kept the existing behaviour on purpose: before this change, the button called clear_cacheCmd($uid), which only flushed the page itself. forRecord('pages', …) would also flush siblings, parent and the targets of TCEMAIN.clearCacheCmd, which is what saving does, and what #99843 complains about on large trees. This patch should be a refactoring without behaviour changes, so I'd rather do this in a follow-up if we agree the button should behave like saving. What do you think?AfterCacheFlushedEvent.php:24ReplyRight, the docblock was outdated. Fixed in PS3: the event is dispatched by CacheFlusher only. cache:flush keeps dispatching the existing CacheFlushEvent, which CacheFlusher now uses for group flushes too, so listeners of CacheFlushEvent see group flushes from the CLI and the backend alike.BeforeRecordRelatedCachesAreFlushedEvent.php:50ReplyThese aren't additional page ids: the list already holds everything core resolved for the record (its page, siblings, parent, grandparent), and listeners can also remove entries via setPageIds(). That's why I kept pageIds, together with addPageId()/getPageIds(). OK for you?CacheFlushPageResolver.php:43ReplyDoneCacheFlushPageResolver.php:59ReplyIt was carried over from DataHandler::prepareCacheFlush(), but it isn't needed: the check is only whether the record is a workspace version. Removed in PS3; it now just reads t3ver_oidCacheFlushRequest.php:24ReplyDone, renamed to CacheFlushDemand -
Benni Mack commented on patch set 3 10/30/26, 10:36
CacheFlushRequest.php:55ReplyDoneCacheFlusher.php:124ReplyDone for null: when no page can be found for the record (the record doesn't exist), it's now skipped as InvalidRecord, with a test. 0 stays valid, because records on the root page, e.g. sys_redirect, need their tags flushed and the root TSconfig applied.CacheFlushingContext.php:26ReplyDocblock fixed. The default context is meant for code running without a backend user, such as scheduler tasks or custom commands.DataHandler.php:8904ReplyAgreed, but as a follow-upDataHandler.php:8910ReplyDone, the new internal CacheFlushLogger is used by DataHandler and ClearCacheController.RemoveIndexedContentOfChangedPages.php:39ReplyDoneRemoveIndexedContentOfChangedPages.php:44ReplyDoneFlushPageCachesOnTemplateChange.php:28ReplyMoved, but to EXT:frontend rather than core: the sys_template TCA lives in EXT:frontend, so the listener now sits next to the table it is about.FlushPageCachesOnTemplateChange.php:34ReplyMostly its subtree, but other templates can include it via basedOn, so a change can affect pages in completely different trees. Flushing only the subtree would leave those stale, so it stays a flush of all page caches, as the old clearCachePostProc hook did. I added that to the docblock. Narrowing it down, e.g. by resolving basedOn users, could be a follow-up. -
Benni Mack marked it ready for review 10/30/26, 10:49
-
Daniel Windloff commented on patch set 3 10/30/26, 13:05
ClearCacheController.php:81ReplyKeeping the existing behavior is fine. I just came across the difference as I compare the actual generated cache tags to flush. I did not expect any difference here.BeforeRecordRelatedCachesAreFlushedEvent.php:50ReplyI wanted to express this distinction between the pid and the additional pids derived from it. While reading, I found the use of both `pageId` and `pageIds` find the two terms not very clearly distinguishable. -
Daniel Windloff voted on patch set 3 CR +1 V +1 10/30/26, 13:32
-
Garvin Hicking uploaded patch set 4
CR +1V +110/30/26, 14:23 -
Garvin Hicking uploaded patch set 5 10/30/26, 14:35
-
Garvin Hicking uploaded patch set 6 10/30/26, 14:35
-
core-ci voted on patch set 4 V -1 10/30/26, 14:37 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112882
-
Garvin Hicking commented on patch set 6 10/30/26, 14:37
I've added a small ReST change. Found two issues for which I've added a failing test only for now, would like your feedback: 1. pid=0 records aren't flushed 2. "flush all caches" flushes twice, might create race conditions? "One thing worth noting" ;) - The docs say that `resolve()` is side-effect free, while in reality possible `BeforeXXX` events are recommended to perform changes. These would be performed in a `resolve()` call too, and then maybe already have executed changes. Not sure if that is worth pointing out though. -
core-ci voted on patch set 6 V -1 10/30/26, 14:50 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112884
-
core-ci voted on patch set 5 V -1 10/30/26, 14:51 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112883
-
Benni Mack uploaded patch set 7
V -110/30/26, 17:01 -
Benni Mack commented on patch set 6 10/30/26, 17:01
Reply
Both issues were valid, and are now covered. -
core-ci voted on patch set 7 V -1 10/30/26, 17:13 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112895
-
Benni Mack uploaded patch set 8
V -110/30/26, 17:58 -
core-ci voted on patch set 8 V +1 10/30/26, 18:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112898
-
Garvin Hicking voted on patch set 8 CR +1 V +1 10/30/26, 20:15
-
Benni Mack uploaded patch set 9
CR +1V +110/30/26, 21:30 -
Garvin Hicking voted on patch set 9 CR +1 V +1 10/30/26, 21:34
-
core-ci voted on patch set 9 V +1 10/30/26, 21:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112917
-
Daniel Windloff voted on patch set 9 CR +1 V +1 10/31/26, 04:12
-
Benni Mack voted on patch set 9 CR +2 V +2 10/31/26, 07:48
-
Benni Mack merged patch set 10 10/31/26, 07:49
ClearCacheController.php:81