[BUGFIX] Configure main extbase caches for unlimited entry lifetime 69/24069/3
authorChristian Kuhn <lolli@schwarzbu.ch>
Thu, 26 Sep 2013 14:12:25 +0000 (16:12 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 26 Sep 2013 19:42:41 +0000 (21:42 +0200)
The extbase reflection and object caches are "stable" cache entries
and only need to be deleted if extensions change or are updates. The
extension manager takes care of flushing in this case.
Currently, the default lifetime of those cache entries is only one
hour, so they are recalculated pretty often. This is especially a
problem if the site was not accessed for more than an hour, since
tons of cache entries exceeded their lifetime and require
recalculation.
The patch moves the cache configuration of the required extbase
extension to DefaultConfiguration and sets unlimited default
lifetime for object and reflection cache.

Change-Id: I671692645aeb104f7fa73595cc79b25ed5984b85
Resolves: #52305
Related: #51116
Related: #52304
Releases: 6.2, 6.1, 6.0
Reviewed-on: https://review.typo3.org/24069
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/core/Configuration/DefaultConfiguration.php
typo3/sysext/extbase/ext_localconf.php

index 2fac5b1..63d14fa 100644 (file)
@@ -175,6 +175,19 @@ return array(
                                        'frontend' => 'TYPO3\CMS\Core\Cache\Frontend\VariableFrontend',
                                        'backend' => 'TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend',
                                        'options' => array(),
+                               'extbase_object' => array(
+                                       'frontend' => 'TYPO3\CMS\Core\Cache\Frontend\VariableFrontend',
+                                       'backend' => 'TYPO3\CMS\Core\Cache\Backend\Typo3DatabaseBackend',
+                                       'options' => array(
+                                               'defaultLifetime' => 0,
+                                       ),
+                               ),
+                               'extbase_reflection' => array(
+                                       'frontend' => 'TYPO3\CMS\Core\Cache\Frontend\VariableFrontend',
+                                       'backend' => 'TYPO3\CMS\Core\Cache\Backend\Typo3DatabaseBackend',
+                                       'options' => array(
+                                               'defaultLifetime' => 0,
+                                       ),
                                ),
                        ),
                ),
@@ -756,4 +769,4 @@ return array(
        ),
        'SVCONF' => array()
 );
-?>
+?>
\ No newline at end of file
index f353447..56269a8 100644 (file)
@@ -6,19 +6,13 @@ if (!defined('TYPO3_MODE')) {
 require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('extbase') . 'Classes/Mvc/Dispatcher.php';
 require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('extbase') . 'Classes/Utility/ExtensionUtility.php';
 
-// Register caches if not already done in localconf.php or a previously loaded extension.
-if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['extbase_reflection'])) {
-       $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['extbase_reflection'] = array();
-}
-if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['extbase_object'])) {
-       $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['extbase_object'] = array();
-}
 if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['extbase_typo3dbbackend_tablecolumns'])) {
        $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['extbase_typo3dbbackend_tablecolumns'] = array();
 }
 if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['extbase_datamapfactory_datamap'])) {
        $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['extbase_datamapfactory_datamap'] = array();
 }
+
 // We need to set the default implementation for Storage Backend & Query Settings
 // the code below is NO PUBLIC API! It's just to make sure that
 // Extbase works correctly in the backend if the page tree is empty or no