I need to make my minicart not include in Magento's FPC. So, I've added below code to my layout's default.xml file.

<block class="Magento\Framework\View\Element\Template" name="custom.header" template="Magento_Theme::html/header.phtml" cacheable="false">
                        <argument name="target" xsi:type="string">contentarea</argument>
                        <argument name="label" translate="true" xsi:type="string">Skip to Content</argument>

But, The problem is now header is included in all pages of website, And its make website slower, Like we have disabled cache from admin.

I've seen many questions regarding not to use cacheable="false".

Is there is any solution to make it possible ??

Thanks in Advance.


2 Answers 2


Using cacheable="false" will make your whole page uncacheable. See devDocs here. You can extend the block, add this to it's constructor :

protected function _construct()
        'cache_lifetime' => 0

Try setting cacheable=false for the following block.

<block type="checkout/cart_minicart" name="minicart_head" template="checkout/cart/minicart.phtml" before="-">

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.