Attention
TYPO3 v11 has reached end-of-life as of October 31th 2024 and is no longer being maintained. Use the version switcher on the top left of this page to select documentation for a supported version of TYPO3.
Need more time before upgrading? You can purchase Extended Long Term Support (ELTS) for TYPO3 v11 here: TYPO3 ELTS.
Configuration
Caches are configured in the array $GLOBALS
.
The basic structure is predefined in typo3/
,
and consists of the single section:
- cacheConfigurations: Registry of all configured caches. Each cache is identified by its array key. Each cache can have the sub keys frontend, backend and options to configure the used frontend, backend and possible backend options.
Cache Configurations
Unfortunately in TYPO3, all ext_
files of the extensions are loaded after the instance specific
configuration from Local
and Additional
. This
enables extensions to overwrite cache configurations already done for the instance. All extensions
should avoid this situation and should define the very bare minimum of cache configurations. This
boils down to define the array key to populate a new cache to the system. Without further configuration,
the cache system falls back to the default backend and default frontend settings:
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['myext_mycache'] ??= [];
Extensions like Extbase define default caches this way, giving administrators full freedom for specific and possibly quicker setups (eg. a memory driven cache for the Extbase reflection cache).
Administrators can overwrite specific settings of the cache configuration in Local
,
example configuration to switch pages to the redis backend using database 3:
return [
'SYS' => [
'caching' => [
'cacheConfigurations' => [
'pages' => [
'backend' => \TYPO3\CMS\Core\Cache\Backend\RedisBackend::class,
'options' => [
'database' => 3,
],
],
],
],
],
];
Some backends have mandatory as well as optional parameters (which are documented below). If not all mandatory options are defined, the specific backend will throw an exception if accessed.
How to Disable Specific Caches
During development, it can be convenient to disable certain caches. This is especially helpful for central caches like the language or autoloader cache. This can be achieved by using the null backend (see below) as storage backend.
Warning
Do not use this in production, it will strongly slow down the system!
Example entry to switch the extbase_reflection cache to use the null backend:
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']
['extbase_reflection']['backend'] = \TYPO3\CMS\Core\Cache\Backend\NullBackend::class;