1. Go to this page and download the library: Download weakbit/fallback-cache library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['pages'] = [
// This frontend surrounds the functions by a try, and sends an event on exception (Status yellow)
'frontend' => \Weakbit\FallbackCache\Cache\Frontend\VariableFrontend::class,
'backend' => RedisBackend::class,
'options' => [
'defaultLifetime' => 604800,
'compression' => 0,
],
// If the cache creation fails (Status red) this cache is used
'fallback' => 'pages_fallback',
// Optional: turn yellow status events into red when this rate is exceeded
'yellow_to_red_rate' => '10/minute',
// The concrete frontend the 'frontend' is based on
'concrete_frontend' => \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class,
'groups' => [
'pages',
]
];
// Configure the fallback cache to use the database for example
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['pages_fallback'] = $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['pages'];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['pages_fallback']['backend'] = Typo3DatabaseBackend::class;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['pages_fallback']['options'] = [
'defaultLifetime' => 604800,
];