Posted on 05/05/2020 12:22:40
But we need to store the data on the products, so it is the product cache.
If we call Application.KillProducts(), then cache on all products will be removed and I do not think that is good instead of just changed products?
Right now we are using our own methods:
public class Helper
{
private static string ProductCacheKeyPrefix = "Product_";
internal static void RemoveProductFromCache(string productId, string languageId, string variantId)
{
Cache.Current.Remove(ProductCacheKey(productId, languageId, variantId));
}
private static string ProductCacheKey(string productId, string languageId, string variantId)
{
return $"{ProductCacheKeyPrefix}{productId}_{languageId}_{variantId}";
}
}