Feature #18852

Speed up tslib_cObj->getTreeList by caching its results

Added by Ingo Renner over 11 years ago. Updated about 9 years ago.

Should have
Target version:
Start date:
Due date:
% Done:


PHP Version:
Sprint Focus:


When extensions need to look up where their records are stored they use the startingpoint selector together with the recursion level selector. From these two parameters the method tslib_cObj->getTreeList() builds a comma separated list of page IDs where an extension should look for records.

The method does that by traversing the tree recursivly and issuing an SQL query for each page, depending on the recursion level set and the size of the tree this can result in an enormous number of SQL queries, time loss, and memory consumptions.

create a cache table to store the results of tslib_cObj depending on the parameters the method was called with.
Now that the result is cached the cache also needs to be updated on certain events. These events are

  • create new page
  • move page
  • hide/unhide/delete a page
  • set/unset start/stop time for a page
  • set/unset php tree stop for a page
  • set/unset or change a FE group access restriction for a page

All these events would result in a different result for the getTreeList method, thus the cache must be cleared for these events. However for certain events we can find out which selected parts of the cache to delete and thus do not need to clear the whole cache.

Additionally the new cache will be cleared when clicking "clear all caches". The cache update mechanism is implemented as a hook that is now part of the cms system extension as it is related to pages and pages are part of the cms feature.
(issue imported from #M8515)

8515.diff View (26.9 KB) Administrator Admin, 2008-05-26 11:53

Related issues

Related to TYPO3 Core - Bug #22412: cache_treelist is out of date Closed 2010-04-10
Related to TYPO3 Core - Bug #22552: No cache entry in cache_treelist after endtime arrived Closed 2010-04-30
Related to TYPO3 Core - Bug #26161: cache_treelist is out of date when using starttime New 2011-04-21


#1 Updated by Ingo Renner about 11 years ago

committed to SVN trunk

Also available in: Atom PDF