I'm trying to switch off caching in referenceBlock. I tried:

<referenceBlock name="block.name">
        <argument name="cacheable" xsi:type="boolean">false</argument>


<referenceBlock name="wp.homepage.view" cacheable="false"/>

But none of this is working

  • have you working below code for u? Commented Aug 1, 2016 at 8:35

1 Answer 1


You have to define cacheable="false" within <block> not <referenceBlock>. According to the README for the core PageCache module:

Blocks can also be set as non-cacheable by setting the 'cacheable' attribute in layout XML files.

For example <block class="Block\Class" name="blockname" cacheable="false" />. Pages containing such blocks are not cached.

For example:

<block class="Package\Module\Block\Test" name="block.name" template="Package_Module::test.phtml" cacheable="false"/>

The referenceBlock tag does not support the cacheable attribute.


  • 1
    This is not totally right. The referenceBlock does not support cacheable as an attribute but the way the OP tries to use it is totally valid. Commented Aug 1, 2016 at 9:31
  • can you give me any demo for refereneBlock with cacheable support in magento2? plz if you not know well then not comment plz for cacheble. Commented Aug 1, 2016 at 9:32
  • it is possible to change the block template attribute like this: magento.stackexchange.com/a/86198/2380 so it is definitely possible to change the cacheable attribute the same way Commented Aug 1, 2016 at 9:37
  • @raphael, I haven't seen any demo which support cacheable for referenceBlock, and above given link, have you any answer then plz post so other users can helpful. Here user having issue so you can add answer if possible, i think its not working Commented Aug 1, 2016 at 9:40
  • see the duplicate question the answer is from a developer from the team ;) Commented Aug 1, 2016 at 9:45

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