0

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

1 Answer 1

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 that you have read and understand our privacy policy and code of conduct.

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