Review 14.3 Merged

94603[TASK] Speed up responsive image loading from db

Garvin Hicking CR +2 V +2 Hard +176 −99 updated 07/15/26, 14:41

Commit message

Rendering responsive images creates many variants of the
same original, for instance the widths of a `srcset`.
So far each variant lookup issued its own query to
`sys_file_processedfile`, so a page with a handful of
images in several variants quickly added up to hundreds
of queries.

We now load all variants of an original at once and keep
the rows in the runtime cache. Looking up further variants
of the same already processed original is then served from
that cache instead of the database. This is independent of
how the images are rendered and works for any combination
of controller logic, Fluid ViewHelpers, Fluid loops and
TypoScript `sourceCollection` configuration.

The runtime cache is kept coherent through tagged entries.
Adding, updating and removing a processed file flush
entries of the affected original, and `removeAll()` drops
the whole cache in one go.
The direct table delete in FileDeletionAspect is replaced
by a new remove() method so this path is covered too.
CleanUpLocalProcessedFilesService is moved to constructor
dependency injection and tidied up along the way and
moves a method into the repository, too.

When no responsive images are used and only a single
variant exists, the added overhead is negligible.

Review

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

Issues 1

Files 5

Review log 46

  1. Garvin Hicking commented on patch set 1 06/26/26, 16:36

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V -1 06/26/26, 16:45 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/103954

  3. Garvin Hicking rebased onto patch set 2 V -1 07/15/26, 13:56

  4. core-ci voted on patch set 2 V +1 07/15/26, 14:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104799

  5. Garvin Hicking voted on patch set 2 CR +2 V +2 07/15/26, 14:40

  6. Garvin Hicking merged patch set 3 07/15/26, 14:41