0

In Magento, I can disable cache for static block by add cache_lifetime="null".

{{block type="core/template" cache_lifetime="null" title="BEST SELER!!!" sku="ASS030530010" template="catalog/product/menuproduct.phtml"}}

How can I disable cache for static block on Magento 2?

2
  • 1
    Don't try to disable the cache. If it will disable the whole page cache of the page which contains this block. It will be the bad advice. Commented Nov 12, 2019 at 10:11
  • @KhoaTruongDinh I know it. But I have add login link so, I must check if customer login or not. Do you have any idea? Commented Nov 12, 2019 at 10:32

1 Answer 1

2

You can use this

{{block type="core/template" cacheable="false" title="BEST SELER!!!" sku="ASS030530010" template="catalog/product/menuproduct.phtml"}}

Hope this will help you!

3
  • I have try add cacheable="false" but it doesn't work. Do you have any idea? Commented Nov 12, 2019 at 10:35
  • cacheable="false" should work, redeploy and upgrade. Commented Nov 12, 2019 at 10:53
  • Thank you! I tried but it doesn't it still show login after I logged. Commented Nov 20, 2019 at 3:44

Your Answer

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

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