Product caching issues affecting performance (4.20)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 years ago
Hi,

I need to get some short term performance improvements done on our clients 4.20 site (while we work towards migrating to a newer version).  I have had some good results with adding additional indexes and caching some results in one of our plugins.

But the web site is integrated with the clients internal retail systems (with ~80 stores) and as a result we are seeing hundreds of price updates every day.  We are using the tier pricing (by store) so each store gets their own pricing and I have found that it appears to evict ALL products from the cache when we update just a single price on a product.

ProductService.cs

public virtual void UpdateTierPrice(TierPrice tierPrice)
{
    ....
    _cacheManager.RemoveByPrefix(NopCatalogDefaults.ProductsPrefixCacheKey);
}


If I am reading that correctly it will clear the entire product cache (is that right?).

So instead of that would it be safe to change it to the following?

    _cacheManager.Remove(string.Format(NopCatalogDefaults.ProductsByIdCacheKey, tierPrice.ProductId));


I cannot think of a reason as to why it would not be safe to only remove the single product for the tier price we updated?
3 years ago
Thanks a lot for suggestion. Already implemented (please see here)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.