07-22-2023, 10:46 PM
After switching an ASP.NET MVC 5 application to Azure Redis (`Microsoft.Web.RedisOutputCacheProvider` Nuget package) I was surprised to see that `OutputCacheAttribute` when set to use either `OutputCacheLocation.Any` or `OutputCacheLocation.ServerAndClient`
[Route("Views/Orders")]
[OutputCache(Duration = 600, Location = OutputCacheLocation.Any)]
public ActionResult Orders()
{
}
randomly generates the following error:
> When using a custom output cache provider like 'RedisOutputCache',
> only the following expiration policies and cache features are
> supported: file dependencies, absolute expirations, static
> validation callbacks and static substitution callbacks.
which is weird as the declaration above clearly defines just absolute expiration without any advanced stuff like `varybyparam`. After some searching it looks like there is no fix to [this issue][1] which is extremely frustrating. Are there any external cache providers compatible with ASP.NET caching mechanics? If not, how do you implement server side HTTP output caching in cluster scenarios in MVC/WebApi apps?
[1]:
[Route("Views/Orders")]
[OutputCache(Duration = 600, Location = OutputCacheLocation.Any)]
public ActionResult Orders()
{
}
randomly generates the following error:
> When using a custom output cache provider like 'RedisOutputCache',
> only the following expiration policies and cache features are
> supported: file dependencies, absolute expirations, static
> validation callbacks and static substitution callbacks.
which is weird as the declaration above clearly defines just absolute expiration without any advanced stuff like `varybyparam`. After some searching it looks like there is no fix to [this issue][1] which is extremely frustrating. Are there any external cache providers compatible with ASP.NET caching mechanics? If not, how do you implement server side HTTP output caching in cluster scenarios in MVC/WebApi apps?
[1]:
[To see links please register here]