A fork of ResponseCachingMiddleware which provides more flexibility. Note that it uses official aspnetcore code directly (via git submodules and csproj linking).
For usage see ResponseCachingMiddleware, just replace AddResponseCaching with AddDistributedResponseCaching, and UseResponseCaching with UseDistributedResponseCaching.
It will use whatever implentation of IDistributedCache that is injected into it.
The sky is the limit! Do whatever you want in your own custom response cache. Use AddCustomResponseCaching() and UseCustomResponseCaching().
And add you're custom response cache to the service provider. It must implement ICustomResponseCache. Note that DistributedResponseCache itself is an ICustomResponseCache, so you could use it internaly and implement the interface through it, adding whatever custom wrapper logic you like.
This is a wrapper around DistributedResponseCache which allows you to easily exert some basic control over the underlying IDistributedCache. You can use your own custom logic to force the cache to clear, or to just ignore it.
To use, call AddModifiableDistributedResponseCache() and UseCustomResponseCaching().
And inject IModifiableCacheController into the service provider.