#45089More clever page-caching if content from other page included via TypoScript
Description
Example on a given page (root-page or maybe even just a branch):
page.10.subparts.LEFT {
31 < styles.content.getLeft
31.select.pidInList = 2
}
Now TYPO3 could know what for all pages that include this CONTENT-element it needs to clear the respective page-caches when on page with pid 2 and only if in column-id 1 (left) something is modified or some start/stop-times expire.
Currently TYPO3 doesn’t recognise that automatically and you have to find other ways to clear the cache – hopefully not too often without need.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
History 12
-
Stefan Neufeind commented <span data-processor="relativetime" data-value="2013-02-02T02:38:18+00:00" > 02/02/13, 02:38 </span>
This would be possible using the cachingFramework using cache-tags. It’s already available in 4.5 but must be explicitly enabled.
Currently a page has one tag “pageId_…”. When a CONTENT-object is rendered we could add tags like “pageId_…colPos…”.For the above mentioned example this would mean what we might have a page with “pageId_10” but also “pageId_2_colPos_1”. So whenever something changes in that column it would be clear this page is affected as well (and would need to have a cache-clear triggered).
For a scenario with content-sliding we might have content only in the content on the main column – but if ever content is added on a page inbetween we could knowe we’d need to trigger a clear as well. This chain of tags would need to be built up to the point where the first content is found (as far as the slide needs to go). (Similar but different if collect is used.). So a rootline 1 > 2 > 3 > 4 with content on 1 and a cache for 4 we’d then have “pageId_4 pageId_4_colPos_1 pageId_3_colPos_1 pageId_2_colPos_1 pageId_1_colPos_1”.
-
Ingo Renner commented <span data-processor="relativetime" data-value="2013-02-02T04:00:45+00:00" > 02/02/13, 04:00 </span>
it’s a bit hard to understand from your description but I think I know what you’re trying to do. Sounds like a nifty plan to me.
-
Stefan Neufeind commented <span data-processor="relativetime" data-value="2013-02-02T04:02:09+00:00" > 02/02/13, 04:02 </span>
Currently there seems no easy way for a content-element being rendererd to return other data than it’s actual output.
Looking at the CONTENT-object (TYPO3\CMS\Frontend\ContentObject\ContentContentObject) I found things like
$GLOBALS[‘TSFE’]->recordRegister[$originalRec]
While in general it’s no good idea to pollute the global space further sigh how about we’d create
$GLOBALS[‘TSFE’]->recordMetadata
and have an entry for each rendered content-element (identified with the usual $table:$uid) that wants to write there which could for now write to an array
$GLOBALS[‘TSFE’]->recordMetadata[$originalRec][‘cacheTags’]During the render-process we already have all overlays processed etc. anyhow. And it would be quite lightweight to add this functionality to contentobjects where that funtionality would be used. Before writing the page to the cache that information could then be collected.
Side-effect of a metadata-array: objects could also return things like “cacheTimeout”. And if they do, we could take the smallest value into account to find the minimal page cache-time (although we still need to consider other factors like currently invidible elements that will shortly after become visible etc.).
I know this still might not make the cache-clearing-topic “complete” – but might be one more step.
-
Mathias Schreiber changed target version Is Regression 0 <span data-processor="relativetime" data-value="2015-01-14T09:31:05+00:00" > 01/14/15, 09:31 </span>
-
Benni Mack changed target version <span data-processor="relativetime" data-value="2015-06-15T17:44:48+00:00" > 06/15/15, 17:44 </span>
-
Susanne Moog changed target version <span data-processor="relativetime" data-value="2015-08-05T10:27:55+00:00" > 08/05/15, 10:27 </span>
-
Benni Mack changed target version <span data-processor="relativetime" data-value="2015-09-24T20:42:53+00:00" > 09/24/15, 20:42 </span>
-
Mathias Schreiber changed target version <span data-processor="relativetime" data-value="2015-10-28T10:48:32+00:00" > 10/28/15, 10:48 </span>
-
Riccardo De Contardi changed category <span data-processor="relativetime" data-value="2016-06-30T17:30:05+00:00" > 06/30/16, 17:30 </span>
-
Benni Mack changed target version <span data-processor="relativetime" data-value="2017-03-28T22:26:21+00:00" > 03/28/17, 22:26 </span>
-
Christian Kuhn commented and changed status
NewClosed <span data-processor="relativetime" data-value="2026-04-23T11:47:13+00:00" > 04/23/26, 11:47 </span>Hey. I’m gonna close here: FE improved in this area quite a bit. CE’s can add tags, plugins can add tags. While the situation is still not perfect but do-able, details should be sorted out with fresh patches if needed.
any ideas already on how to solve this issue or did you just file it as a note?