3

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

3
+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.

  • I know it will disable to cache entire page from full page but i want to know will it create issue with varnish cache? – Kul Nov 14 '18 at 15:56
  • Please check edit. – Vivek Kumar Nov 14 '18 at 16:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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