I have added below code to load custom template file from a cms page.
{{block class="TestPointHistoryBlockIndex" template="Test_PointHistory::index.phtml"}}
I want to get the latest data every time I reload this cms page but it always returns data from full page cache.
Can anyone look into this and suggest me?
3
Answers
I found a way to solve this issue. The steps I took to resolve this issue are as follows:
Create a new page layout that inherits Magento's default page layout. Example
Create file
Create file
Go to the Admin and change the layout of the CMS page to
1 column (Disabled FPC)
You could override the
getCacheLifetime()
method in your block class to return null.You have to override this
getCacheLifetime()
with:The other way (better) is to impletement the
IdentityInterface
https://devdocs.magento.com/guides/v2.4/graphql/develop/identity-class.html