I have developed a custom module the retrieve data from database and displayed in a block. The data is updated in database but the page is not showing the latest data if cached is enabled. If the cache is disabled, everything just works fine. Sometimes, even cannot get the customer ID from session if cache is enabled. How to resolve this issue?
Cacheable false should be avoid. It set complete as a non-cache if added false in layout
I finally find out that if we need to get current customer session in a block,
cacheable must be set to
false in the layout xml.
cacheable="false" in OOTB layout.
If page is independent then recommend to use
cacheable="false". Also avoid to add