Issue Bug New

#91561Lifetime of cache is not properly computed for "Insert Records" CE

Xavier Perseguers 06/03/20, 13:59 updated 11/13/26, 13:05

Description

Use case

  • A content element (text/image/…) is prepared and corresponding start/end times are specified
  • This content element is to be used at multiple places on the website and is thus referenced (paste as reference when using EXT:gridelements or simply using “Insert Records” TYPO3-native CE

Expected

  • When the content element on the “master” page finally shows up (or disappears), every page having a reference to that content element should be automatically updated, that is the cache should be invalidated.

Actual behaviour

  • Only the cache of the “master” page is automatically flushed
  • Other page’s caches are not invalidated and a manual flush is required (or a force-reload while being logged-in into the Backend).

Reason

Method \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::getFirstTimeValueForRecord() is supposed to compute the cache lifetime of CEs on a given page. But it only takes into account the start/end fields of the corresponding records.

For “Insert Records” (= shortcut) content element, only the start/end times of the shortcut are taken into account but not the ones of the referenced records.

Expected behaviour: both start/end times of the shortcut CE and all the associated records should be taken into account in that particular context.

In addition, and this could be a real improvement for extension authors, it would be useful to allow extensions to “hook” (PSR-14 if speaking from TYPO3 v10 or master branch, signals/whatever before) so that plugins may benefit from the same possibility than this very shortcut CE to post-process the lifetime in the context, e.g., of a plugin doing some temporary caching of external data and where one way (only “good” one?) to properly handle such case is to add tags to the corresponding page cache and to flushByTags() asynchronously when fetching remote data (or force the whole page to be cached for a shorter period of time).

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

Fix this issue

Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch

Commit message
[BUGFIX] Lifetime of cache is not properly computed for "Insert Records" CE Resolves: #91561 Releases: main

History 6

  1. Benni Mack commented <span data-processor="relativetime" data-value="2026-11-13T13:05:41+00:00" > 11/13/26, 13:05 </span>

    Still valid on main. The page cache lifetime only considers tt_content of the current page (plus config.cache.*), so start/end times of records referenced via “Insert Records” are ignored. With the feature toggle frontend.cache.autoTagging enabled, the endtime of a referenced record is respected (rendered records add a cache tag with their lifetime), but a referenced record with a future starttime is not fetched at all and therefore does not shorten the lifetime. The requested extension point exists now (ModifyCacheLifetimeForPageEvent / ModifyCacheLifetimeForRowEvent, see #92535). Related: #93661, #100360.