Review main Merged

81825[FEATURE] Flush cache tags for file and folder operations

Sascha Nowak CR +2 V +2 Normal +181 −2 updated 04/10/26, 18:49

Commit message

This feature is guarded with toggle "frontend.cache.autoTagging" and
experimental for now: The core flushes cache tags for all kinds of
records automatically when they are created, changed or deleted.
For files and folders, this is not the case.
This feature adds cache tag handling for file or folder operations when
they are created, changed or deleted. Also the file metadata changes are
handled correctly now. This leads to a better
editor experience when the cache tags are used correctly.

Review

  • Code review CR +2 Done
    • Georg Ringer +2
    • Garvin Hicking +1
    • Anja Leichsenring +1
  • Verified V +2 Done
    • Georg Ringer +2
    • Garvin Hicking +1
    • core-ci +1 CI

Issues 1

Files 5

Review log 71103

Show 5078 earlier messages
  1. Sascha Nowak uploaded patch set 1 11/21/23, 16:22

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

  3. Sascha Nowak uploaded patch set 2 V -1 11/21/23, 17:32

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

  5. Sascha Nowak uploaded patch set 3 V -1 11/21/23, 17:38

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

  7. Sascha Nowak uploaded patch set 4 V -1 11/21/23, 17:48

  8. Benjamin Franzke updated the commit message in patch set 5 11/21/23, 17:51

  9. Sascha Nowak updated the commit message in patch set 6 11/21/23, 17:53

  10. core-ci voted on patch set 4 V -1 11/21/23, 17:54 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/49274

  11. core-ci voted on patch set 5 V -1 11/21/23, 17:57 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/49276

  12. core-ci voted on patch set 6 V -1 11/21/23, 17:59 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/49277

  13. Sascha Nowak uploaded patch set 7 V -1 11/21/23, 18:22

  14. core-ci voted on patch set 7 V +1 11/21/23, 18:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/49281

  15. Sascha Nowak rebased onto patch set 8 V +1 11/24/23, 08:33

  16. Sascha Nowak rebased onto patch set 9 11/24/23, 09:19

  17. core-ci voted on patch set 8 V -1 11/24/23, 09:36 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/49840

  18. core-ci voted on patch set 9 V +1 11/24/23, 09:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/49850

  19. Jörg Bösche voted on patch set 9 CR +1 11/30/23, 09:14

  20. Benni Mack commented on patch set 9 11/30/23, 10:40

    FlushCacheTagForFolder.php:36

    what about files in subfolders?
  21. Sascha Nowak uploaded patch set 10 CR +1 V +1 12/05/23, 06:26

  22. Sascha Nowak commented on patch set 10 12/05/23, 06:27

    FlushCacheTagForFolder.php:36 Reply

    Done
  23. core-ci voted on patch set 10 V +1 12/05/23, 06:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50347

  24. Sascha Nowak voted on patch set 10 CR +1 V +1 12/08/23, 12:04

  25. Guido Schmechel commented on patch set 10 01/27/24, 22:23

    Cool thing. Tested by changing a description in the metadata and it works! What I'm missing: The topic of cache tags is of course addressed. I'm somehow missing a suitable documentation for this? Perhaps a general note that you can control these in the page properties or in TypoScript, for example, would suffice. What do you think? * https://docs.typo3.org/m/typo3/reference-typoscript/main/en-us/Functions/Cache.html#tags

    FlushCacheTagForMetaData.php:32

    I would also include the EnrichFileMetaDataEvent here. If someone changes the MetaData externally, the cache will presumably also have to be emptied?
  26. Sascha Nowak commented on patch set 10 01/29/24, 19:04

    Reply

    Hi Guido, thanks for your feedback. This patch is just a preparation for the next patch where the cache tags are set automatically. (https://review.typo3.org/c/Packages/TYPO3.CMS/+/81801/14) I'm waiting for some important other stuff from Christian Kuhn to finish the CacheDataCollector API.
  27. Guido Schmechel commented on patch set 10 CR +1 V +1 01/29/24, 19:56

    Reply

    Cool thing! That would also make my points obsolete :-)
  28. Chris Müller uploaded patch set 11 CR +1 V +1 01/30/24, 18:52

  29. core-ci voted on patch set 11 V +1 01/30/24, 18:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52506

  30. Jörg Bösche voted on patch set 11 CR +1 03/25/24, 12:02

  31. Benni Mack commented on patch set 11 03/25/24, 18:53

    FlushCacheTagForFolder.php:33

    why not use ->getFolder()->getFiles(0, 0, Folder::FILTER_MODE_USE_OWN_AND_STORAGE_FILTERS) ?
  32. Sascha Nowak uploaded patch set 12 CR +1 V +1 03/25/24, 19:10

  33. Sascha Nowak commented on patch set 12 03/25/24, 19:10

    FlushCacheTagForFolder.php:33 Reply

    Acknowledged
  34. core-ci voted on patch set 12 V +1 03/25/24, 19:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54934

  35. Sascha Nowak commented on patch set 12 07/12/24, 04:52

    FlushCacheTagForFolder.php:33 Reply

    Good morning @benni@typo3.org, can we get this change merged?
  36. Georg Ringer uploaded patch set 13 V +1 07/12/24, 17:22

  37. Georg Ringer voted on patch set 13 CR +1 V +1 07/12/24, 17:26

  38. core-ci voted on patch set 13 V +1 07/12/24, 17:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61501

  39. Guido Schmechel voted on patch set 13 CR +1 V +1 07/14/24, 10:51

  40. Christian Kuhn commented on patch set 13 CR -1 07/15/24, 10:30

    I'm not convinced we should do this right now. This flushes tags that are not actually set, leading to quite a few DB operations (with db caches) without actual use.
  41. Georg Ringer rebased onto patch set 14 CR +1 V +1 08/01/24, 18:41

  42. core-ci voted on patch set 14 V +1 08/01/24, 18:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/62608

  43. Georg Ringer rebased onto patch set 15 V +1 08/04/24, 16:23

  44. core-ci voted on patch set 15 V +1 08/04/24, 16:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/62832

  45. Sascha Nowak rebased onto patch set 16 V +1 08/26/24, 06:43

  46. core-ci voted on patch set 16 V -1 08/26/24, 06:52 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64179

  47. Sascha Nowak rebased onto patch set 17 V -1 08/27/24, 12:11

  48. core-ci voted on patch set 17 V -1 08/27/24, 12:25 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64303

  49. Sascha Nowak uploaded patch set 18 V -1 09/16/24, 18:35

  50. Sascha Nowak uploaded patch set 19 09/16/24, 18:37

  51. Sascha Nowak commented on patch set 18 CR +1 V +1 09/16/24, 18:37

    FlushCacheTagForMetaData.php:32 Reply

    Done
  52. core-ci voted on patch set 18 V +1 09/16/24, 18:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65919

  53. core-ci voted on patch set 19 V +1 09/16/24, 18:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65920

  54. Christian Kuhn commented on patch set 19 09/16/24, 19:53

    With the autoTagging feature being merged, it is imho a task or maybe even a bugfix to take care of flushing by tag on file and folder operations properly: we should see after feature freeze on how to improve this detail.
  55. Sascha Nowak uploaded patch set 20 V +1 12/06/24, 15:45

  56. Sascha Nowak voted on patch set 20 CR +1 V +1 12/06/24, 15:45

  57. core-ci voted on patch set 20 V +1 12/06/24, 15:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/70714

  58. Sascha Nowak voted on patch set 20 CR 0 V 0 03/26/25, 06:05

  59. Sascha Nowak rebased onto patch set 21 V +1 03/26/25, 06:05

  60. core-ci voted on patch set 21 V +1 03/26/25, 06:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76338

  61. Benni Mack wrote 03/28/25, 09:33

    Hashtag added: lolli-feedback
  62. Simon Schaufelberger commented on patch set 21 03/28/25, 09:45

    FlushCacheTagForFolder.php:44

    add data type for File

    Feature-102430-FlushCacheTagsForFileAndFolderOperations.rst:28

    with them
  63. Simon Schaufelberger uploaded patch set 22 V +1 03/28/25, 11:10

  64. Simon Schaufelberger commented on patch set 21 03/28/25, 11:11

    FlushCacheTagForFolder.php:44 Reply

    Done

    Feature-102430-FlushCacheTagsForFileAndFolderOperations.rst:28 Reply

    Done
  65. Simon Schaufelberger uploaded patch set 23 03/28/25, 11:18

  66. core-ci voted on patch set 22 V -1 03/28/25, 11:19 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76568

  67. core-ci voted on patch set 23 V +1 03/28/25, 11:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76569

  68. Simon Schaufelberger uploaded patch set 24 V +1 03/28/25, 11:44

  69. core-ci voted on patch set 24 V +1 03/28/25, 11:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76573

  70. Sascha Nowak uploaded patch set 25 V +1 08/15/25, 04:32

  71. Sascha Nowak uploaded patch set 26 08/15/25, 04:33

  72. core-ci voted on patch set 25 V +1 08/15/25, 04:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83426

  73. core-ci voted on patch set 26 V +1 08/15/25, 04:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83428

  74. Sascha Nowak rebased onto patch set 27 V +1 11/08/25, 10:20

  75. Sascha Nowak uploaded patch set 28 11/08/25, 10:22

  76. core-ci voted on patch set 27 V +1 11/08/25, 10:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/88691

  77. core-ci voted on patch set 28 V +1 11/08/25, 10:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/88692

  78. Simon Schaufelberger commented on patch set 28 11/08/25, 11:32

    FEATURE is main only.
  1. Simon Schaufelberger commented on patch set 28 11/08/25, 11:32

    Feature-102430-FlushCacheTagsForFileAndFolderOperations.rst:1

    move into 14.0
  2. Josef Glatz updated the commit message in patch set 29 V +1 11/10/25, 10:11

  3. Josef Glatz commented on patch set 29 11/10/25, 10:12

    Reply

    Done
  4. core-ci voted on patch set 29 V +1 11/10/25, 10:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/88818

  5. Sybille Peters commented on patch set 29 V +1 02/01/26, 10:50

    Very nice. :) I tested with a scaled (processed) image connected to textmedia element and the page cache was not flushed before applying patch. With patch, the page cache was flushed when I uploaded new file overwriting previous.
  6. Josef Glatz rebased onto patch set 30 V +1 02/09/26, 14:42

  7. Sascha Nowak uploaded patch set 31 02/09/26, 14:45

  8. Sascha Nowak commented on patch set 31 02/09/26, 14:45

    Feature-102430-FlushCacheTagsForFileAndFolderOperations.rst:1 Reply

    Done
  9. core-ci voted on patch set 30 V +1 02/09/26, 14:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95472

  10. core-ci voted on patch set 31 V +1 02/09/26, 14:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95473

  11. Anja Leichsenring voted on patch set 31 CR +1 V +1 02/09/26, 19:57

  12. Simon Schaufelberger commented on patch set 31 02/09/26, 23:03

    Just to make you aware, I tried something similar already long time ago and realized how complex this will become once you consider references, records,... https://review.typo3.org/c/Packages/TYPO3.CMS/+/74442
  13. Sascha Nowak commented on patch set 31 02/10/26, 06:36

    Reply

    Hi Simon, thanks for the hint. I think it’s much less complex now, since the cache tags for files and file references are already added during rendering, so we don’t have to query them separately anymore. This patch ensures that these pages are flushed correctly.
  14. Garvin Hicking commented on patch set 31 03/03/26, 07:46

    FlushCacheTagForFolder.php:42

    no named argument here per our guidelines (even though this hurts I must agree)

    ResourceStorage.php:2097

    Is this a leftover? I see no public calls to the method?
  15. Anja Leichsenring uploaded patch set 32 CR +1 V +1 03/03/26, 07:56

  16. Anja Leichsenring commented on patch set 32 CR +1 V +1 03/03/26, 07:57

    FlushCacheTagForFolder.php:42 Reply

    Done

    ResourceStorage.php:2097 Reply

    I reverted it to protected.
  17. core-ci voted on patch set 32 V +1 03/03/26, 08:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97155

  18. Garvin Hicking voted on patch set 32 CR +1 V +1 03/03/26, 08:11

  19. Georg Ringer commented on patch set 32 CR -1 03/03/26, 08:23

    Feature-102430-FlushCacheTagsForFileAndFolderOperations.rst:14

    would be great to rephrase that. the description should start with what this change does. I still not really get if this just adds cache tags or also uses those and where the limitations are: so is it only if using the backend or or also frontend file changes with FAL api
  20. Anja Leichsenring commented on patch set 32 V 0 03/03/26, 09:47

    Feature-102430-FlushCacheTagsForFileAndFolderOperations.rst:14 Reply

    I also pinged lolli about its remarks from last year.
  21. Garvin Hicking commented on patch set 32 03/03/26, 21:37

    Feature-102430-FlushCacheTagsForFileAndFolderOperations.rst:14 Reply

    From what I gather the events are fired in the regular repositories which are also used when utilizing FAL in the Frontend. The cache tags are created if you read feature RST feature-104990-1726495719 - it also applies to the frontend. So these tags are now also properly flushed on removal operations. IMO this really makes sense.
  22. Garvin Hicking commented on patch set 32 03/03/26, 21:38

    Feature-102430-FlushCacheTagsForFileAndFolderOperations.rst:14 Reply Unresolved

    (This is a direct relation chain descendant: https://review.typo3.org/c/Packages/TYPO3.CMS/+/81801)
  23. Georg Ringer voted on patch set 32 CR +2 V +2 03/07/26, 06:27

  24. Georg Ringer merged patch set 33 03/07/26, 06:27

  25. Christian Kuhn wrote 04/10/26, 18:49

    Hashtag removed: lolli-feedback