cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2 targeted cache clearing

Magento 2 targeted cache clearing

I'm trying to determine if its possible to clear the Magento 2.2.6 EE caches at certain levels on our multi-website setup. We're using the built in full page caching, and we're using file storage, not database storage (but could change if needed). I'm looking for a programmatic solution since we have a custom admin interface we could implement this on.  Here are the questions I'm trying to get answered.

 

1.) Can I clear caches related to a specific product, on one or more websites that product exists on?

2.) Can I clear a category page cache for a specific website, or all websites?

3.) Can I clear all caches for a specific website?

2 REPLIES 2

Re: Magento 2 targeted cache clearing

Hello @joseph_digiovanna 

 

1.) Can I clear caches related to a specific product, on one or more websites that product exists on? : it you save any product automatically it will clear cache for each website.

https://github.com/magento/magento2/tree/2.3-develop/app/code/Magento/CacheInvalidate/etc

responsible for this.

2.) Can I clear a category page cache for a specific website, or all websites? : it will do cache flush for all website wise.
Magento save cache based on category Id, if you save category Id then it will flush cache for that category Id

3.) Can I clear all caches for a specific website? : no you need to flush cache by tags.

 

for 3 point, may be possible for varnish.

 

Hope it will help you. if help you then mark as a solution.


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: Magento 2 targeted cache clearing

Hello @joseph_digiovanna 

 

1.) Can I clear caches related to a specific product, on one or more websites that product exists on? : it you save any product automatically it will clear cache for each website.

https://github.com/magento/magento2/tree/2.3/develop/app/code/Magento/CacheInvalidate/etc

responsible for this.

2.) Can I clear a category page cache for a specific website, or all websites? : it will do cache flush for all website wise.
Magento save cache based on category Id, if you save category Id then it will flush cache for that category Id

3.) Can I clear all caches for a specific website? : no you need to flush cache by tags.

 

for 3 point, may be possible for varnish.

 

Hope it will help you. if help you then mark as a solution.


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer