Review main Merged

90551[BUGFIX] Ensure additional cache tags are applied for localized pages

Elias Häußler CR +2 V +2 Easy +46 −4 updated 10/09/25, 13:18

Commit message

When rendered pages are being cached, appropriate cache tags in the form
`pages_<pageId>` and `pageId_<pageId>` are added. This applies to pages
in the default language as well as to localized pages. In contrast to
pages in the default language, cache tags for localized pages are added
using the page id of their corresponding page record in default
language. This way, pages in the default language as well as localized
pages are tagged as `pages_1` and `pageId_1`, for example, if the page
uid of the page in the default language is `1`.

This is due to historical reasons: When the `pages_language_overlay`
table still existed, an additional tagging of localized pages using
their localized page uid was performed. However, when this table got
merged with the `pages` table, the additional tagging for localized
pages using their localized page uid was not taken over and thus did not
applied anymore.

With this patch, the previous behavior is now restored: Once a localized
page is requested, an additional cache tag using the localized page uid
is now applied. This way, localized pages are now tagged with the
default page uid as well as the localized page uid.

Given the following scenario:

    * Default page uid: 1
    * Localized page uid (DE): 2
    * Localized page uid (CZ): 3

The following cache tags are now generated:

+-----------------------+----------------+----------------+
|                       | Old behavior   | New behavior   |
+-----------------------+----------------+----------------+
| Default page          | * `pages_1`    | * `pages_1`    |
| (page uid=1)          | * `pageId_1`   | * `pageId_1`   |
+-----------------------+----------------+----------------+
| Localized page (DE)   | * `pages_1`    | * `pages_1`    |
| (page uid=2)          | * `pageId_1`   | * `pageId_1`   |
|                       |                | * `pages_2`    |
|                       |                | * `pageId_2`   |
+-----------------------+----------------+----------------+
| Localized page (CZ)   | * `pages_1`    | * `pages_1`    |
| (page uid=3)          | * `pageId_1`   | * `pageId_1`   |
|                       |                | * `pages_3`    |
|                       |                | * `pageId_3`   |
+-----------------------+----------------+----------------+

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Christian Kuhn +1
    • Stefan Froemken +1
  • Verified V +2 Done
    • Benni Mack +2
    • Stefan Froemken +1
    • core-ci +1 CI

Issues 1

Files 4

Review log 1623

  1. Elias Häußler uploaded patch set 1 09/03/25, 07:55

  2. Elias Häußler marked it work in progress 09/03/25, 07:56

  3. core-ci voted on patch set 1 V +1 09/03/25, 08:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84304

  4. Elias Häußler uploaded patch set 2 V +1 09/03/25, 08:06

  5. Elias Häußler uploaded patch set 3 09/03/25, 08:06

  6. Elias Häußler updated the commit message in patch set 4 09/03/25, 08:09

  7. core-ci voted on patch set 2 V -1 09/03/25, 08:15 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84307

  8. core-ci voted on patch set 3 V +1 09/03/25, 08:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84308

  9. core-ci voted on patch set 4 V +1 09/03/25, 08:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84309

  10. Elias Häußler uploaded patch set 5 V +1 09/03/25, 08:57

  11. core-ci voted on patch set 5 V +1 09/03/25, 09:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84310

  12. Elias Häußler marked it ready for review 09/03/25, 09:09

  13. Benni Mack voted on patch set 5 CR +1 09/03/25, 14:49

  14. Benni Mack updated the commit message in patch set 6 CR +1 V +1 09/05/25, 09:22

  15. Stefan Froemken commented on patch set 6 09/05/25, 09:28

    Thank you for that patch. I like the example. I would appreciate, if you extend the example with previous handling and new handling. I have contacted Benni about TYPO3 12.4. He has removed it. TYPO3 12.4 will only get security and critical backports.
  16. core-ci voted on patch set 6 V +1 09/05/25, 09:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84447

  17. Elias Häußler uploaded patch set 7 V +1 09/10/25, 18:26

  18. Elias Häußler commented on patch set 7 09/10/25, 18:26

    Reply

    Can you have a second look, please?
  19. core-ci voted on patch set 7 V +1 09/10/25, 18:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84794

  20. Stefan Froemken commented on patch set 7 CR +1 V +1 09/12/25, 07:43

    Reply

    Done
    Thank you for taking care of that. In earlier versions the cache identifiers differs while keeping the same cache tag. After the patch the identifier for translated content gets an additional cache tag with the Page UID of the translated page. Perfect. The clear this pages cache button in list-view will remove all entries of the page, also the entries with the new cache tag. Perfect. I have created a new page with TCEMAIN.clearCacheCmd = cacheTag:pageId_18 to test, ig that will also remove ALL cache entries of the other page. Works. Perfect. I have also tested with workspacing, but that does not make sense, as your are logged in into TYPO3 BE and in that case no cache entry will be generated.
  21. Christian Kuhn voted on patch set 7 CR +1 10/09/25, 13:08

  22. Benni Mack voted on patch set 7 CR +2 V +2 10/09/25, 13:18

  23. Benni Mack merged patch set 8 10/09/25, 13:18