Your AdminNoCachePolicy
does not look right, you can inspect how OutputCacheMiddleware
is executed here:
Also look at how the default implementation looks like, after that copy paste it and make changes so that it reflects your logic.
Specifically, notice the lack of the following block in your policy:
context.AllowCacheLookup = attemptOutputCaching;
context.AllowCacheStorage = attemptOutputCaching;
context.AllowLocking = true;
// Vary by any query by default
context.CacheVaryByRules.QueryKeys = "*";
See how AllowCacheLookup
and AllowCacheStorage
is used in the middleware.