I am trying to disable cache for specific block, Have used below code. appcodeVendorModuleviewfrontendlayoutdefault.xml <referenceContainer name="header.panel"> <block class="VendorModuleBlockIndex" name="custom_block" template="html/custom.phtml"/> </referenceContainer> appcodeVendorModuleBlockIndex.php <?php namespace VendorModuleBlock; class Index extends MagentoFrameworkViewElementTemplate { public function __construct( MagentoFrameworkViewElementTemplateContext $context array $data = [] ) { parent::__construct($context, $data); $this->_isScopePrivate = false; } public function getCacheLifetime() […]