Magento 2 Certification Questions List | What is the difference between setting cacheable="false" on a block in layout XML attribute and the block's getCacheLifetime() === null?

What is the difference between setting cacheable="false" on a block in layout XML attribute and the block's getCacheLifetime() === null?

Answer:
  • cacheable="false" prevents the entire page from caching. getCacheLifetime() === null prevents the block from being cached, but it would still be cached by the full page caching mechanism
Prepear for Magento 2 certefication with our interactive quiz