79531028

Date: 2025-03-24 12:16:16
Score: 1
Natty:
Report link

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.

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: bgajic