Skip to content

Commit

Permalink
fix: blocks got not rendered if whole layout is not cacheable
Browse files Browse the repository at this point in the history
  • Loading branch information
rommelfreddy authored Sep 16, 2024
1 parent e6bab6b commit 28d18ab
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Plugin/LayoutPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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`
}

Expand Down

0 comments on commit 28d18ab

Please sign in to comment.