Feature #14700

Support to clear cache only in subtrees when changing TS

Added by Peter Russ over 14 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2005-04-22
Due date:
% Done:

0%

PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

Added support to clear cache only in subtrees starting at the actual pid of an template. If you want to use this feature you have to add

$TYPO3_CONF_VARS['BE']['clearCacheSubTreeOnly'] = 1;

to localconf.php.

Will only work in template mode for the moment. I.e. all other clear_cacheCmd('all') will work as usual.
(issue imported from #M1031)

class.t3lib_tcemain.php.dif (2.47 KB) Administrator Admin, 2005-04-22 16:27


Related issues

Related to TYPO3 Core - Feature #15698: Allowing non-admins in the tstemplate module. Closed 2006-02-22
Related to TYPO3 Core - Feature #60045: Allow disabling cache clearing in tstemplate modules Closed 2014-07-01
Related to TYPO3 Core - Feature #63011: Implement "clear cache of page and all sub pages" by correct tagging, use in template module New 2014-11-16

History

#1 Updated by Karsten Dambekalns over 14 years ago

I definitely like this feature - the only questions is, do we want it in 3.8.0? After all, it is more a feature than a bug, right?

#2 Updated by Michael Stucki over 14 years ago

Yes it is a feature. Last week Rupert Germann has had a deeper look at the patch.

As far as I remember him saying the main problem is that this is only implemented in the template module view and nowhere else.

A 2nd problem is the inconsistency which would be introduced with that: Clicking "Clear FE cache" will cause different actions depending on where you clicked that link.

I suggest someone implements this as an extension first and we'll try to bring it back in 3.9.0.

- michael

#3 Updated by Peter Russ over 14 years ago

@k-fish: this was originally added as a feature request.

@stucki: the reason for the "inconsitency" is very simple: if you do a redesign or layout testing for an existing site, EVERY TIME you make a change in TS the COMPLETE cache is deleted AUTOMATICALLY by DEFAULT.
That might be pretty hard for indexed-search. On the other hand when you click manually "Clear FE cache" you should know what you do.

I would recommed to add the feature as it leaves everything unchanged if not activated.

#4 Updated by Peter Russ over 14 years ago

Additionally you could add the value only to a special pagetree which would help developing and testing of new TS and leaves behavoir "consistent" for the rest.

- Peter

#5 Updated by Michael Stucki over 14 years ago

Hallo Rupi,
Du kennst Dich besser damit aus. Was hältst Du davon?

#6 Updated by Rupert Germann over 14 years ago

hi peter,
you wrote: " EVERY TIME you make a change in TS the COMPLETE cache is deleted AUTOMATICALLY by DEFAULT. ... "

This is only true if you make this changes in the "web/template" module. When saving template records in the "web/list" view this doesn't happen.
didn't know this until now.

But I think tcemain is not the right place to change this.
The command to clear the cache is initiated by this line in: typo3/ext/tstemplate_info/class.tx_tstemplateinfo.php
$tce->clear_cacheCmd("all");

that's the place where the "tree IDs" should be collected and then added as list to the clear_cacheCmd e.g.:
$tce->clear_cacheCmd("1,2,3,4,5,6,7");

of course only if "clearCacheSubTreeOnly" is set.

another thing:
you wrote also "That might be pretty hard for indexed-search...."
The index of the indexed search is not influenced by cleaning the cache. Never.

rupi

#7 Updated by Peter Russ over 14 years ago

The solution provided is optimized for no side effects.

IMHO t3lib_div::testInt($cacheCmd) at t3lib_clearcacheCmd is a bug that prevents the elegant solution that rupi suggested and that was taken into account when providing the solution.

But as this feature was introduced at a time when stucki claimed that there was no feature freeze for 3.8. the intention was to add as "less bugs" as possible with the solution provided.

We could design and test the elegant solution for one of the next releases. But if you have hundreds of pages in cache you might wish to reduce the number of pages deleted from cache when making changes in subtrees of the template.

#8 Updated by Rupert Germann over 14 years ago

t3lib_div::testInt($cacheCmd) is no bug because t3lib_clearcacheCmd is never called with arrays but for every single command or single page id in the list of commands.

IMO it's a good idea to postpone this feature for TYPO3 3.9.0 (or for a new version of "tstemplate_info")

peter wrote "But if you have hundreds of pages in cache you might wish to reduce the number of pages deleted from cache when making changes in subtrees of the template."

then edit templates in list mode and clear the tree under the changed template with the admin panel.

#9 Updated by Peter Russ over 14 years ago

@rupi: ref to 2179 you recommened a solution like $tce->clear_cacheCmd("1,2,3,4,5,6,7") but now you are claiming that "t3lib_clearcacheCmd is never called with arrays"?
From my understanding of Typo3 this is an array "1,2,3,4,5,6,7" and
!strcmp($var,intval($var)) will always return false. Am I wrong?

Pls. have a look at the original code:
$list_cache=array($cacheCmd);
So the intention was there to support "arrays". BUT testInt delimits the usability. Otherwise the implode in the following exec_DELETEquery would be totaly obsolute. And this would be either poor design or is just a bug.

"then edit templates in list mode and clear the tree under the changed template with the admin panel." : Von hinten durch d' Brust ins Aug'. Oder: warum einfach, wenn's kompliziert auch geht.

IMO we should add this feature "hidden" as this has no (AGAIN NO side effects!) and get information from people using that to improve. I bet there are more features implemented that have more side effects.

#10 Updated by Alexander Stehlik about 5 years ago

Christian Kuhn proposed a quite promising solution for this in #60046.

Maybe we can finally get this going, this issue is ancient ;)

#11 Updated by Christian Kuhn about 5 years ago

  • Description updated (diff)
  • Status changed from Accepted to Closed
  • Target version deleted (0)
  • PHP Version deleted (4)

Feature may be done with #63011 - this one here is closed.

Also available in: Atom PDF