Bug #23718
closedThe default lifetime of the cache has a wrong value and can not be changed
0%
Description
The variable $defaultLifetime is set to 3600 instead of 0 (like documentated) in the t3lib_cache_backend_AbstractBackend class.
This value can not be changed when creating a t3lib_cache_frontend_StringFrontend or t3lib_cache_frontend_VariableFrontend object.
(issue imported from #M15975)
Updated by Steffen Kamper about 14 years ago
this is not correct
$this->backend->setDefaultLifetime(10000)
Updated by Dimitri about 14 years ago
it can only be used from a t3lib_cache_backend_xx object
so like i have said, if usind a t3lib_cache_frontend_xx class the backend variable is protected
$cache->backend->setDefaultLifetime(10000) doesnt work from a frontend cache class
Updated by Christian Kuhn almost 14 years ago
According to test theConstructorCallsSetterMethodsForAllSpecifiedOptions() in tests/t3lib/cache/backend/t3lib_cache_backend_abstractbackendTest.php it should be possible to configure something like:
$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations'] = array(
'foocache' = array(
'frontend' => 't3lib_cache_frontend_VariableFrontend',
'backend' => 't3lib_cache_backend_DbBackend',
'options' => array(
'defaultLifetime' = 123,
),
),
);
Could you please confirm? Does this solve you issue?
Updated by Christian Kuhn almost 14 years ago
Resolved, no change required:
The default cache time can be set with a localconf.php setting for any cache.
See http://wiki.typo3.org/Caching_framework for details.
Updated by Carsten Bleicker over 13 years ago
i wonder why my page is so slow after 1 hour.
seems to be the defaultLifetime of extBase extension cache.
this one will build a lot of stuff in its own tables and i want this cache by default unlimited.
but if i try to change the defaultLifeTime for both extBase Cache tables it only changed on one of them, not both:
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_extbase_object']['options']['defaultLifetime'] = 0;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_extbase_reflection']['options']['defaultLifetime'] = 0;
after this change in ext_tables.php the records in the database has the following lifeTime:
cache_extbase_reflection => 0
cache_extbase_object => 3600
why cache_extbase_object has still the default value?
thank you
carsten