_From @JunTaoLuo on Thursday, September 15, 2016 2:15:48 PM_
Currently we only set the absolute timeouts for cache entries. There is no mechanism to explicitly invalidate a cache entry before expiry. Also, how would applications/users interact with this feature?
Note that invalidation is required by the RFC for unsafe methods, e.g. a successful PUT should invalidate any previous cached resources at the same URI.
_Copied from original issue: aspnet/ResponseCaching#38_
_From @refactorthis on Friday, March 31, 2017 9:38:12 AM_
endpoints that mutate state should invalidate the previous cached item by default as you mention. It would also be beneficial to have the ability to inject a service that allows invalidating cached items on demand. For example an event received over a bus may mutate the objects state which would require invalidation. This may however be out of scope and better handled by abstracting the cache to a different layer?
_From @muratg on Thursday, May 25, 2017 3:42:26 PM_
@glennc If we want to do this in the future, we should get together and agree on a design.
_From @justintubbs on Wednesday, August 9, 2017 12:19:14 PM_
Any update on this? Cache invalidation would be a killer feature both for REST API interactions, but also SignalR or other types of event buffers/message queues that cause the underlying data to mutate.
How is this not solved yet? This is a common use case:
@muratg @glennc, just checking in. Any updates on this one? I'm working with a customer whose scenario sounds similar to @xantari's. Being able to invalidate items from the cache would make response caching a lot more useful in that scenario.
Most helpful comment
How is this not solved yet? This is a common use case: