Project

General

Profile

Actions

Bug #45089

open

More clever page-caching if content from other page included via TypoScript

Added by Stefan Neufeind over 11 years ago. Updated about 7 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Caching
Start date:
2013-02-02
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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.

Actions #1

Updated by Ingo Renner over 11 years ago

any ideas already on how to solve this issue or did you just file it as a note?

Actions #2

Updated by Stefan Neufeind over 11 years ago

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".

Actions #3

Updated by Ingo Renner over 11 years ago

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.

Actions #4

Updated by Stefan Neufeind over 11 years ago

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.

Actions #5

Updated by Mathias Schreiber over 9 years ago

  • Target version set to 7.2 (Frontend)
  • Is Regression set to No
Actions #6

Updated by Benni Mack almost 9 years ago

  • Target version changed from 7.2 (Frontend) to 7.4 (Backend)
Actions #7

Updated by Susanne Moog almost 9 years ago

  • Target version changed from 7.4 (Backend) to 7.5
Actions #8

Updated by Benni Mack over 8 years ago

  • Target version changed from 7.5 to 7 LTS
Actions #9

Updated by Mathias Schreiber over 8 years ago

  • Target version changed from 7 LTS to 8 LTS
Actions #10

Updated by Riccardo De Contardi almost 8 years ago

  • Category set to Caching
Actions #11

Updated by Benni Mack about 7 years ago

  • Target version changed from 8 LTS to Candidate for Major Version
Actions

Also available in: Atom PDF