Is there a way to use wildcards or a regex to search and remove items from HttpContext.Cache
?
I can have in my cache "item_1", "item_2",...,"item_n" and I want to remove from cache all values that are related to keys with the pattern "item_*". How to achieve that without checking if the item exists and then remove it?
Ex:
instead of:
HttpContext.Current.Cache.Remove("item_1")
HttpContext.Current.Cache.Remove("item_2")
HttpContext.Current.Cache.Remove("item_3")
I want something like:
HttpContext.Current.Cache.Remove("item_*")