I want to make a specific cms page to be set as a non-cacheable page.

Is there is a way to add XML code in layout update to achieve same

enter image description here

I'm calling block in page HTML with code as below

<p>{{block class="Magento\Framework\View\Element\Template" template="Magento_Theme::html/test.phtml"}}</p>

1 Answer 1


You can use the below code to achieve it using XML.

<block class="Magento\Framework\View\Element\Template" name="test_view" template="Magento_Theme::html/test.phtml"/>

To make the page non-cacheable you can use cacheable attribute.

<block class="Magento\Framework\View\Element\Template" name="test_view" template="Magento_Theme::html/test.phtml" cacheable="false" />

Hope this helps!

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.