2

I am making a online payment method, which is taking previous cart details if Full page cache is enabled. How can we make it non cache-able? I want to make my HTML content non - cache-able.

Raphael at Digital Pianism
70.8k37 gold badges192 silver badges357 bronze badges
asked Sep 28, 2016 at 6:20

4 Answers 4

3

You have to use cacheable="false" for your perticular section or block.

ex.

<block class="Magento\Captcha\Block\Captcha" name="captcha" cacheable="false"></block>

You can get more info from core modules of magento.

answered Sep 28, 2016 at 6:23
2
3

Short answer: you can't.

Long answer:

Using cacheable="false" will make the entire page that contains this block not cacheable. So you don't disable cache for one block. You can find more references below:

answered Sep 28, 2016 at 7:46
0

You have to add with your block in layout file

cacheable="false"

For Exanple

<block class="Magento\Checkout\Block\Registration" name="checkout.registration" template="registration.phtml" cacheable="false"/>
answered Sep 28, 2016 at 6:24
0

This method is never recommended.
This is because the entire page cache cannot be handled with this approach.

answered Nov 19, 2021 at 5:36

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.