Project

General

Profile

Actions

Feature #14700

closed

Support to clear cache only in subtrees when changing TS

Added by Peter Russ over 19 years ago. Updated about 10 years ago.

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

0%

Estimated time:
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)


Files

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

Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Feature #15698: Allowing non-admins in the tstemplate module.ClosedMichael Stucki2006-02-22

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

Actions
Related to TYPO3 Core - Feature #63011: Implement "clear cache of page and all sub pages" by correct tagging, use in template moduleClosed2014-11-16

Actions
Actions #1

Updated by Karsten Dambekalns over 19 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?

Actions #2

Updated by Michael Stucki over 19 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

Actions #3

Updated by Peter Russ over 19 years ago

@Karsten Dambekalns: this was originally added as a feature request.

@Michael 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.

Actions #4

Updated by Peter Russ over 19 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

Actions #5

Updated by Michael Stucki over 19 years ago

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

Actions #6

Updated by Rupert Germann over 19 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

Actions #7

Updated by Peter Russ over 19 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.

Actions #8

Updated by Rupert Germann over 19 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.

Actions #9

Updated by Peter Russ over 19 years ago

@Rupert Germann: 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.

Actions #10

Updated by Alexander Stehlik about 10 years ago

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

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

Actions #11

Updated by Christian Kuhn about 10 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.

Actions

Also available in: Atom PDF