4

I have store in Magento2 and planning to integrate varnish cache. Want to confirm if there is an issue with cacheable="false".

Vivek Kumar
5,7932 gold badges26 silver badges55 bronze badges
asked Nov 8, 2018 at 14:19

1 Answer 1

4
+50

cacheable="false" will disable caching for the entire page where it is included. So, it is highly recommended to not use it in blocks which are included in all pages.

To get around this, you will have to use cache hole punching.You can follow this blog post for the details-

https://trellis.co/blog/magento2-fpc-hole-punching/

You can also look into how to invalidate private content in magento devdocs here,

https://devdocs.magento.com/guides/v2.2/extension-dev-guide/cache/page-caching/private-content.html

as most of the times these contents are only the ones which we do not want cached.

EDIT:

As magento excplicitly sends X-Magento-Cache-Control headers to no-cache when cacheable="false" , there will be no caching whether you are using Varnish,Fastly or Magento's default full page cache.

answered Nov 14, 2018 at 15:52
2
  • I know it will disable to cache entire page from full page but i want to know will it create issue with varnish cache? Commented Nov 14, 2018 at 15:56
  • 1
    Please check edit. Commented Nov 14, 2018 at 16:02

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.