Merge conflict Gerrit cannot merge this change. It needs a rebase onto main.

Review main Ready for review Stale

85450[FEATURE] Add PSR-14 events for augmenting and restoring page cache data

Tim Weisenberger CR -1 V -1 Normal +237 −4 updated 06/18/26, 23:06

Commit message

Introduces PSR-14 events that allow adding and restoring additional
cache data. These events can be used to enrich cached pages with
metadata or to adjust the cache lifetime before the entry is written to
the backend.

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 14
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/50/85450/14 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/50/85450/14 && git cherry-pick FETCH_HEAD

Review

  • Code review CR -1 Needs a vote
    • Georg Ringer -1
    • Sascha Nowak +1
    • Simon Schaufelberger -1
  • Verified V -1 Blocked
    • Sascha Nowak +1
    • Simon Schaufelberger -1
    • core-ci +1 CI

Issues 1

Files 5

Review log 3246

Show 1421 earlier messages
  1. Tim Weisenberger uploaded patch set 1 08/01/24, 20:46

  2. core-ci voted on patch set 1 V +1 08/01/24, 21:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/62655

  3. Stefan Bürk commented on patch set 1 08/01/24, 22:00

    I'd say we should not introduce hooks anymore and better user a PSR-14 event. Beside that, FEATURES are main only and also needs a corresponding feature rst file describing the event. Testing the events should also be included (that they are dispatched and the added data can really be added to the cache.
  4. Tim Weisenberger uploaded patch set 2 V +1 08/21/24, 12:43

  5. core-ci voted on patch set 2 V -1 08/21/24, 12:52 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63909

  6. Tim Weisenberger uploaded patch set 3 V -1 08/21/24, 12:55

  7. core-ci voted on patch set 3 V -1 08/21/24, 13:05 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63912

  8. Tim Weisenberger uploaded patch set 4 V -1 09/16/24, 16:10

  9. core-ci voted on patch set 4 V -1 09/16/24, 16:27 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65908

  10. Tim Weisenberger uploaded patch set 5 V -1 09/16/24, 16:28

  11. Tim Weisenberger commented on patch set 5 09/16/24, 16:31

    Reply

    Thanks for your feedback. I pushed a new patchset which implements the same functionality based on a PSR-14 event. I also tried to add tests for the event in the TypoScriptFrontendController, but the event can only be tested with a lot of mocking effort, as there is no direct access to the method. I have also noticed that many of the recent patches for PSR-14 events do not include any tests. Therefore my question is if a test is really essential for this patch?
  12. Sascha Nowak voted on patch set 5 CR +1 09/16/24, 16:34

  13. Tim Weisenberger uploaded patch set 6 CR +1 09/16/24, 16:37

  14. core-ci voted on patch set 5 V -1 09/16/24, 16:46 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65912

  15. core-ci voted on patch set 6 V +1 09/16/24, 16:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65913

  16. Sascha Nowak voted on patch set 6 CR +1 09/16/24, 16:55

  17. Sascha Nowak uploaded patch set 7 CR +1 V +1 12/06/24, 15:48

  18. Sascha Nowak voted on patch set 7 CR +1 V +1 12/06/24, 15:48

  19. core-ci voted on patch set 7 V +1 12/06/24, 15:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/70715

  20. Sascha Nowak commented on patch set 7 12/06/24, 16:15

    Reply

    Acknowledged
  21. Simon Schaufelberger uploaded patch set 8 CR +1 V +1 12/07/24, 13:45

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

  2. Sascha Nowak voted on patch set 8 CR +1 V +1 12/10/24, 10:36

  3. Christian Kuhn commented on patch set 8 CR -1 12/10/24, 12:05

    i would like to postpone this feature until tsfe is gone, to see if we still need it then: its possible these events are not needed anymore and could be middlewares.
  4. Benni Mack commented on patch set 8 12/10/24, 18:42

    we previously used AfterCacheableContentIsGeneratedEvent for that.
  5. Sascha Nowak uploaded patch set 9 CR +1 V +1 08/18/25, 17:31

  6. core-ci voted on patch set 9 V -1 08/18/25, 17:39 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83576

  7. Sascha Nowak uploaded patch set 10 V -1 08/18/25, 17:59

  8. core-ci voted on patch set 10 V +1 08/18/25, 18:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83577

  9. Jan Delius commented on patch set 10 V +1 09/26/25, 14:03

    Feature-104529-IntroducePSR14EventPageCacheRecord.rst:23

    I don't know why gerrit shows that so strange. When downloading this patch via git, the rst looks correct

    Feature-104529-IntroducePSR14EventPageCacheRecord.rst:37

    I think we don't need this argument here

    Feature-104529-IntroducePSR14EventPageCacheRecord.rst:56

    I think we don't need this argument here
  10. Tim Weisenberger uploaded patch set 11 V +1 11/08/25, 14:51

  11. Tim Weisenberger uploaded patch set 12 11/08/25, 14:55

  12. Tim Weisenberger uploaded patch set 13 11/08/25, 15:01

  13. core-ci voted on patch set 11 V +1 11/08/25, 15:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/88702

  14. Tim Weisenberger commented on patch set 13 11/08/25, 15:04

    Feature-104529-IntroducePSR14EventPageCacheRecord.rst:23 Reply

    It was also broken in git, but now it is fixed. Thanks.

    Feature-104529-IntroducePSR14EventPageCacheRecord.rst:37 Reply

    Good point, done.

    Feature-104529-IntroducePSR14EventPageCacheRecord.rst:56 Reply

    Good point, done.
  15. core-ci voted on patch set 12 V +1 11/08/25, 15:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/88703

  16. core-ci voted on patch set 13 V +1 11/08/25, 15:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/88704

  17. Simon Schaufelberger commented on patch set 13 11/08/25, 15:15

    Feature-104529-PSR14EventsForAddingAndRestoringAdditionalPageCacheData.rst:23

    remove trailing whitespace. maybe wrong configuration in your ide?
  18. Tim Weisenberger uploaded patch set 14 V +1 11/08/25, 19:36

  19. core-ci voted on patch set 14 V +1 11/08/25, 19:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/88714

  20. Simon Schaufelberger commented on patch set 14 CR +1 V +1 11/08/25, 19:52

    Feature-104529-PSR14EventsForAddingAndRestoringAdditionalPageCacheData.rst:23 Reply

    Done
  21. Sascha Nowak voted on patch set 14 CR +1 V +1 11/08/25, 20:31

  22. Simon Schaufelberger commented on patch set 14 CR -1 V -1 11/29/25, 11:44

    TypoScriptFrontendController.php:127 Unresolved

    TSFE is gone, this needs bigger refactoring
  23. Georg Ringer commented on patch set 14 CR -1 03/15/26, 07:54

    code is still the same in typo3/sysext/frontend/Classes/Http/RequestHandler.php but IMO the current AfterCachedPageIsPersistedEvent is perfectly fine for also modifying the data?!
  24. Benni Mack wrote 04/21/26, 14:51

    Removed cc Benni Mack.
  25. Christian Kuhn wrote 06/18/26, 23:06

    Removed reviewer Christian Kuhn.