2

Magento page cache cached some of the blocks that has dynamic value, like Wishlist count on header for logged in customers

I can make it dynamic using Ajax, but then it came to my knowledge that it could also be done using Hole punch. (Not cacheable="false")

My question is, how can I set hole punch for wishlist count on header? I need a path where I can do some research on this

I have checked this post, but it has no a satisfactory answer: How to use Identities for to implementing hole punching in my custom module magento 2

  • You would need to find some other way rather cacheable="false" on that block because if you set cacheable false on any block it invalidates cache of whole page, for more you can check devdosc. devdocs.magento.com/guides/v2.1/config-guide/cache/… – Naveed Asim Mar 19 at 5:59
  • Yes, that's why I have added in question Not cacheable="false" – Shoaib Munir Mar 19 at 6:05
  • just want to share this stackoverflow.com/questions/9120413/… – magefms Mar 19 at 7:11
  • 1
    @magefms thanks for sharing, but the post is too old, and it is related to Magento 1 – Shoaib Munir Mar 19 at 7:17
  • 1
    @magefms I had read this article, it is telling to disable whole page from Page cache or Flush cache when something is changed. I don't think this article is good read. – Shoaib Munir Mar 19 at 9:52

Your Answer

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

Browse other questions tagged or ask your own question.