Project

General

Profile

Actions

Feature #63011

closed

Implement "clear cache of page and all sub pages" by correct tagging, use in template module

Added by Christian Kuhn over 9 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Caching
Target version:
-
Start date:
2014-11-16
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
hard
Sprint Focus:

Description

This text was a response to #60045 / #60046 in the first place.

Scenario: An instance under load with lots of TS records that are changed on live directly. While this is often an unwanted scenario, it still may happen for "microsites" instances - lots of sites with small page trees. The clearCacheCmd('all') fired by the TypoScript module is then disadvantegous, since it kills way too many cache entries where only entries of the page with the TS record and all its children should be cleared.

The solution to just disable the page clear however is not sufficient, since caches of subpages are not cleared, so the proposed solution is only useful if pages with a changed TS record have no sub pages.

More general approach: Tag a fe cache entry with its rootline. So if a cache entry belongs to page 42 which is a child of page 23 and that is a child of page 5, then page 42 cache entry would be tagged with "isChildOf_23" and "isChildOf_5" (or similar). The change the TS module to not fire clearCacheCmd('all'), but clearCacheCmd('cacheTag:isChildOf_5') if TS record of page 5 is changed. clearCacheCmd can do that already. Cache entry for page 23 and 42 would be cleared then. Also flush by tag "PageId_5". If done, exactly the correct cache entries would be killed and nothing more.
It may only happen that if you "flushByTag" a page that alredy has lots of sub pages takes quite some time, so in this case it may be quicker to just "flush whole cache" - this does a truncate on Typo3DbBackend cache and an rm -r on file caches and is much quicker than a lengthy "delete nearly everything". So, we'd probably need PageTS that controls the flush behaviour (with default to flushByTag).

Tagging caches in the frontend with its "rootline" could be beneficial for other things as well, maybe for the list/page module for example: Eg. storing a record on a storage page X then triggers a "clear caches of page Y and Z and all their sub pages, which is currently also not possible.

Todo:
Find out if the above solution is sane and do-able.
Add functionality to add "rootline" tags to cache_pages in the frontend.
Find out usage of pagesection and see if this one can be tagged as well or if the cache entries are re-used on different pages again - which may torpedo the above idea.
Find a sane pageTS syntax to feed clearCacheCmd with options like 'kill everthing below "me"' and implement it.
I'm not 100% sure if the above will survive all checks, but it sounds like a good idea to me. Better tagging in the frontend is long overdue anyway and it may help us at other places as well. I've raised some attention towards this issue to some active contributors already (eg. Markus Klein and Helmut Hummel), we think that this issue could probably be solved this way, but at the moment no one is really digging deep into that and actually working on it - this is one reason why an answer took longer, I'm really sorry for that.

Alexander, what do you think, is this a good idea and are you feeling you could dive into this overall topic and search for progress here? I would happily help with providing more information, ideas and technical insights that I have on my radar - eg. I know the caching framework pretty well, but I don't know the FE details on my own without digging myself.

I know that the proposed solution is much more complex than just disabling the clear cache action, but I really think this would go into the right direction. My gut feeling is this would be do-able and won't end in "complexity hell", cache_pages should be fine, my only doubts are regarding sub cache layers like pagesection, those should get an eye first.


Related issues 4 (0 open4 closed)

Related to TYPO3 Core - Feature #60045: Allow disabling cache clearing in tstemplate modulesClosed2014-07-01

Actions
Related to TYPO3 Core - Feature #14700: Support to clear cache only in subtrees when changing TSClosed2005-04-22

Actions
Related to TYPO3 Core - Task #89280: TypoScript Template Constant Editor flushes to many caches, results in slow frontend responses due to DI rebuildClosedBenjamin Franzke2019-09-25

Actions
Has duplicate TYPO3 Core - Feature #20305: clearCacheCmd should support recursionClosed2009-04-11

Actions
Actions #1

Updated by Mathias Schreiber about 6 years ago

is this still valid?

Actions #2

Updated by Peter Linzenkirchner over 5 years ago

It would be a handy feature. Until TYPO3 7 i used the extension sm_clearcachecm for this use case, but the extension gets no more updates. So yes, i think this would be very usefull.

Actions #3

Updated by Franz Kugelmann over 4 years ago

To clear caches of whole branches via context menu, see also
https://github.com/cobwebch/branch_cache

Currently supporting TYPO3 8LTS.

Actions #4

Updated by Susanne Moog about 4 years ago

  • Category set to Caching
Actions #5

Updated by Georg Ringer about 4 years ago

  • Related to Task #89280: TypoScript Template Constant Editor flushes to many caches, results in slow frontend responses due to DI rebuild added
Actions #6

Updated by Georg Ringer about 4 years ago

  • Status changed from New to Closed

with #89280 a different strategy has been implemented, therefore I am closing this issue.

Actions

Also available in: Atom PDF