1

I have created an extension which I have uploaded in the marketplace but marketplace rejected due to cacheable="false".

<block class="Company\Module\Block\Hello" name="information" template="Company_Module::details.phtml" cacheable="false"/>

I have removed this cacheable attribute from xml then my extension not working properly.

Now if I make some process in product page or category page in my extension then data is stored properly in the database. But if when I refresh the page then it will display old data directly from cache.

If I manually apply cache clean command then refresh the page then it displays data correctly the first time. I am getting this issue in the custom page as well as in product page and category page.

$this->customFactory->create()->getCollection();

I have written this code in a block and used this block function in phtml.

Anyone knows how can we get collection directly from the database and not from the cache when the cache is enabled in Magento 2.

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.