.../src/CacheabilitySafeguardsServiceProvider.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/modules/cacheability_safeguards/src/CacheabilitySafeguardsServiceProvider.php b/core/modules/cacheability_safeguards/src/CacheabilitySafeguardsServiceProvider.php index 83d69be..78a8b37 100644 --- a/core/modules/cacheability_safeguards/src/CacheabilitySafeguardsServiceProvider.php +++ b/core/modules/cacheability_safeguards/src/CacheabilitySafeguardsServiceProvider.php @@ -20,6 +20,11 @@ class CacheabilitySafeguardsServiceProvider implements ServiceModifierInterface * {@inheritdoc} */ public function alter(ContainerBuilder $container) { + // Allow sites to opt out from the cacheability safeguards. + if ($container->hasParameter('cacheability_safeguards') && $container->getParameter('cacheability_safeguards') === FALSE) { + return; + } + // Also make the 'user.permissions' cache context required. if ($container->hasParameter('renderer.config')) { $renderer_config = $container->getParameter('renderer.config');