cancel
Showing results for 
Search instead for 
Did you mean: 

How to refresh magento 2 page cache of my module tag only?

How to refresh magento 2 page cache of my module tag only?

Hello,

 

Magento 2 by default using page cache and it is very good feature.

 

But there is one question related to that:

 

Let's explain with one example:

I am working on blog module and the customer can also add a new comment . By default approve status so when somebody submit a comment on the blog, it will display on blog post.

 

But when page cache enabled then admin must need to refresh cache for display cache. Is there any way to refresh only my module page cache?

 

 

public function beforeSave()
{
$this->_cacheManager->clean();
return $this;
}

Above code  this is working fine but it refresh all cache not only my module cache.

 

Is there any way to refresh only my module tag cache?

 

Look forward your reply

 

 

1 REPLY

Re: How to refresh magento 2 page cache of my module tag only?

How to clean the Magento 2 cache partially by tags: https://mage2.pro/t/699