Project

General

Profile

Actions

Story #54991

closed

Improve caching framework by introducing groups

Added by Benni Mack almost 11 years ago. Updated about 7 years ago.

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

100%

Estimated time:
(Total: 0.00 h)
TYPO3 Version:
6.2
PHP Version:
Tags:
Sprint Focus:

Description

The current TYPO3 Core includes different types of caches. There are system-related caches (class loading cache, configuration cache, l10n_cache extbase_object, extbase_reflection etc.) and frontend-related caches (chash cache, page cache, page section cache). The usability of "clear all caches" for BE users is here problematic, as TYPO3 has to set up all (!) caches again if somebody moves a page. Two important features are missing:

1) Caches that are excluded when clearing the "regular" caches.
Certain caches need to be built-up and added (no warm-up phase possible though), but only change in a development environment or if an extension is installed/uninstalled. Think of the l10n_cache - this should never be flushed in a production environment.

2) Certain core-related system caches should not have a life-time (and should not be flushed all the time), as in production mode, the template files won't change.

This shows that currently it is dealt with "page-related caches", and with "system-related caches" and they should be handled differently.

-- Implementation idea

In each Cache Configuration, there is a new "groups" parameter, that shows in which groups the cache should be included. The cache explains in what groups the cache is located. Example:

$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['cache_classes'] = array(
'backend' => 'TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend'
'frontend' => 'TYPO3\CMS\Core\Cache\Frontend\StringFrontend'
'options' => ...
'groups' => array('frontend,pages,system')
);

The cache manager, the only instance currently handling cache configurations currently, identifies when a cache is created, in which groups the cache is put and stores this in a separate new property of this cache manager.

As this is a configuration option in an array, it is possible to change groups depending on the environment, so the development environment can even set system-related caches on each page hit ;).

Things to do in the first steps:

  • add new property in CacheManager "$groups"
  • evaluate the "groups" parameter in "CacheManager->createCache()"
  • add new methods in CacheManager "flushCacheGroup($group)", "flushCacheGroupByTag($group, $tag)"
  • define groups and set groups to all cache configurations in the Core
  • replace functionality of "clear cache" in DataHandler to clear all caches, except system caches
Second step:
  • Have the icons in the page modules etc. and in the top bar not use DataHandler anymore, but use the CF directly.
  • Replace "Configuration Cache" by "System Cache" in the top toolbar.
Related steps:
  • configure default lifetime of "system" caches to unlimited lifetime

If this is done, the TYPO3 system will run extremely faster, as cache clearing is becoming "normal" again. :)


Files

caching_framework.patch (18.8 KB) caching_framework.patch Benni Mack, 2014-01-15 09:31

Subtasks 1 (0 open1 closed)

Task #55035: Create clear cache command to clear system cachesRejected2014-01-15

Actions

Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Task #54984: "Clear all caches" makes the site unavailable for several secondsClosed2014-01-14

Actions
Related to TYPO3 Core - Bug #55877: Property ListUtility::$objectManager does not exist Closed2014-02-11

Actions
Related to TYPO3 Core - Bug #57064: New option clearCache.system does not show upClosedFrancois Suter2014-03-19

Actions
Actions #2

Updated by Gerrit Code Review almost 11 years ago

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26829

Actions #3

Updated by Gerrit Code Review almost 11 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26829

Actions #4

Updated by Gerrit Code Review almost 11 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26829

Actions #5

Updated by Gerrit Code Review almost 11 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26829

Actions #6

Updated by Gerrit Code Review almost 11 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26829

Actions #7

Updated by Gerrit Code Review almost 11 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26829

Actions #8

Updated by Gerrit Code Review almost 11 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26829

Actions #9

Updated by Benni Mack almost 11 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100
Actions #10

Updated by Riccardo De Contardi about 7 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF