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

Review main Work in progress

95067[BUGFIX] Cache busting for images rendered by Fluid

Benjamin Kott CR -2 V 0 Hard +602 −334 updated 11/15/26, 07:39

Commit message

An image rendered without processing instructions is served from its
original location, and its URI never changed when the file behind it was
replaced, so browsers and caching proxies kept serving the previous
contents. A processed image was never affected: its file name carries
the processing checksum, and that checksum covers the modification time
of the original.

This is what made integrators pass the result of f:uri.resource into the
"src" argument of f:image, which is where the reported exception came
from: f:uri.resource returns a public URI including a cache buster,
while "src" expects a FAL identifier or an "EXT:" path. The workaround
existed because the ViewHelper did not do the busting itself.

f:image, f:uri.image, f:media and f:image.srcset now append the cache
buster themselves whenever the rendered URI points at an unaltered
original, reusing the SHA-1 that f:uri.resource already appends for the
same file. There is deliberately no argument to switch this off: serving
a stale image after an editor replaced a file is a defect rather than a
preference, and the checksum in a derivative's file name has never been
optional either.

The cache buster is now carried by a named query parameter,
"cacheBuster", instead of being appended as a bare value, so that a
storage driver signing its public URLs, a reverse proxy or a log reader
can recognise and strip it instead of guessing what an anonymous token
means. The name is exposed as CacheBustingUri::QUERY_PARAMETER. This
covers every URI the system resource publisher busts, so the icon
providers, the asset renderer and f:uri.resource change shape as well.

The exception raised for a source string that can not be resolved now
names the supported alternatives when that string carries a query or a
fragment, so templates still using the old workaround explain
themselves.

Two test adjustments are unrelated to the expectations that simply
gained the cache buster: FluidEmailTest decodes the quoted-printable
body before searching it, because the longer URIs shift the soft line
breaks, and ImageViewHelperTest gained cases for the busted original and
for the derivative that must stay untouched.

Executed commands:
CI=true ./Build/Scripts/runTests.sh -s unit
CI=true ./Build/Scripts/runTests.sh -s functional
CI=true ./Build/Scripts/runTests.sh -s cgl -n
CI=true ./Build/Scripts/runTests.sh -s phpstan

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 4
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/67/95067/4 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/67/95067/4 && git cherry-pick FETCH_HEAD

Review

  • Code review CR -2 Blocked
    • Helmut Hummel -2
  • Verified V 0 Needs a vote
    • core-ci +1 CI

Issues 4

Files 41

Show 21 more files

Review log 1012

  1. Benjamin Kott uploaded patch set 1 08/02/26, 14:35

  2. Benjamin Kott uploaded patch set 2 08/02/26, 17:24

  3. Benjamin Kott wrote 08/26/26, 07:25

    Unset private
  4. Benjamin Kott uploaded patch set 3 08/26/26, 07:55

  5. core-ci voted on patch set 3 V -1 08/26/26, 08:01 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107128

  6. Andreas Kienast uploaded patch set 4 V -1 08/26/26, 08:11

  7. core-ci voted on patch set 4 V +1 08/26/26, 08:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107129

  8. Helmut Hummel commented on patch set 4 CR -1 09/03/26, 11:59

    I'm not to convinced about the currently suggested implementation. I try to make a different suggestion, as cache busting is already covered by resources API

    CacheBustingUri.php:31 Unresolved

    This comment is meant as is. This class should remain internal to system resources
  9. Helmut Hummel commented on patch set 4 CR -2 09/03/26, 12:07

    I can't come up with a different suggestion until the question about the cache busting is answered. I will therefore block this until we clarify the demands.

    CacheBustingUri.php:90 Unresolved

    Why is the existing cache busting replaced with a different one?
  10. Helmut Hummel commented on patch set 4 09/04/26, 09:54

    Unresolved

    here is an alternative that solves exactly one thing (cache busting for images rendered by Fluid): https://review.typo3.org/c/Packages/TYPO3.CMS/+/95636
  11. Helmut Hummel marked it work in progress 09/04/26, 09:54

  12. Benni Mack commented on patch set 4 11/15/26, 07:39