[BUGFIX] Configure main extbase caches for unlimited entry lifetime 81/24081/2
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:43:30 +0000 (21:43 +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
(cherry picked from commit 690a3713830fc25e39e9f26937376b0aba10412d)
Reviewed-on: https://review.typo3.org/24081

typo3/sysext/core/Configuration/DefaultConfiguration.php
typo3/sysext/extbase/ext_localconf.php

index 88e3a72..81fc545 100644 (file)
@@ -179,6 +179,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,
+                                       ),
                                ),
                        ),
                ),
index 479aff9..732ca6e 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
@@ -57,4 +51,4 @@ if (TYPO3_MODE === 'BE') {
        // register help command
        $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['extbase']['commandControllers'][] = 'TYPO3\\CMS\\Extbase\\Command\\HelpCommandController';
 }
-?>
\ No newline at end of file
+?>