diff --git a/src/Plugin/LayoutPlugin.php b/src/Plugin/LayoutPlugin.php index 491445b..fc09ba3 100644 --- a/src/Plugin/LayoutPlugin.php +++ b/src/Plugin/LayoutPlugin.php @@ -22,7 +22,12 @@ public function aroundRenderNonCachedElement(Layout $subject, callable $callable { $block = $subject->getBlock($name); - if ($block instanceof AbstractBlock && is_numeric($block->getTtl()) && ((int)$block->getTtl()) > 0 && $this->isVarnishEnabled()) { + if ($block instanceof AbstractBlock + && is_numeric($block->getTtl()) + && ((int)$block->getTtl()) > 0 + && $this->isVarnishEnabled() + && $block->getLayout()->isCacheable() + ) { return ''; // esi tag will be added by event observer `core_layout_render_element` }