Custom Caching Configuration silently keeps the options-Array
when using the new caching configuration UI in v10 in the configuration presets area, one can crash a site.
This happens depending on the configuration you activate before setting a custom configuration. For the sake of simplicity let's just have a look at the pages cache.
If you activate the Typo3DatabaseBackend, this is a part of what is written into the LocalConfiguration.php:
'pages' => [ 'backend' => 'TYPO3\\CMS\\Core\\Cache\\Backend\\Typo3DatabaseBackend', 'options' => [ 'compression' => 1, ], ],
If you activate the FileBackend, this will be written instead:
'pages' => [ 'backend' => 'TYPO3\\CMS\\Core\\Cache\\Backend\\FileBackend', 'options' => [ 'compression' => '__UNSET', ], ],
Note that the compression is unset here. If you now insert a custom configuration, e.g. APCuBackend, you end up with this:
'pages' => [ 'backend' => 'TYPO3\\CMS\\Core\\Cache\\Backend\\ApcuBackend', 'options' => [ 'compression' => '__UNSET', ], ],
This is fine, unless you had the Typo3DatabaseBackend active beforehand, which leads to this:
'pages' => [ 'backend' => 'TYPO3\\CMS\\Core\\Cache\\Backend\\ApcuBackend', 'options' => [ 'compression' => 1, ], ],
This will cause errors, because the ApcuBackend can not use compression.
So if your custom configuration breaks the site or not depends on the configuration you had before switching it, since the options-Array is only updated when you use the preconfigured cache-backends.
I marked this as a feature, since I think that people who use a custom configuration will most likely use the AdditonalConfiguration or directly edit the LocalConfiguration.php anyway (as stated in the hints in the configuration presets).
But if you only want to "try out" different caching backends using the UI, you might end up with a broken configuration (and errors on the site / the backend).
I think it would be useful to always unset the compression (and more options, depending on the capability of other cache backends). This way, the configuration also might not be perfect, but at least it would not cause errors.