Is your feature request related to a problem? Please describe the problem.
Hi,
I am using Output Caching with Redis in my .NET 8 web API. The IOutputCacheStore API only provides a method for evicting cache by tags and not by cache keys. This is limiting, as the Tag() method in the CacheOutput fluent API chain only accepts strings as parameters and does not allow for delegates, unlike the VaryByValue() method, where we can access the HttpContext and query parameters to dynamically create cache keys. As a result, it's not possible to dynamically create a tag in the same way as in VaryByValue() to use as input for the EvictByTag() method.
I have overridden the caching policy to allow output caching of authenticated requests, enabling me to cache by an ID value (e.g., user ID) and evict the cache entry associated with that specific value.
Is there a way to address this issue, allowing more granular cache eviction by user or query parameter, without having to evict the entire cache for the endpoint in ASP.NET Core Output Caching?
Describe the solution you'd like
An fluent api that allows evicting cache entries by value in Asp.Net Core OutputCaching
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
Hi,
I am using Output Caching with Redis in my .NET 8 web API. The IOutputCacheStore API only provides a method for evicting cache by tags and not by cache keys. This is limiting, as the Tag() method in the CacheOutput fluent API chain only accepts strings as parameters and does not allow for delegates, unlike the VaryByValue() method, where we can access the HttpContext and query parameters to dynamically create cache keys. As a result, it's not possible to dynamically create a tag in the same way as in VaryByValue() to use as input for the EvictByTag() method.
I have overridden the caching policy to allow output caching of authenticated requests, enabling me to cache by an ID value (e.g., user ID) and evict the cache entry associated with that specific value.
Is there a way to address this issue, allowing more granular cache eviction by user or query parameter, without having to evict the entire cache for the endpoint in ASP.NET Core Output Caching?
Describe the solution you'd like
An fluent api that allows evicting cache entries by value in Asp.Net Core OutputCaching
Additional context
No response