ResponseCache
is somewhat a replacement for OutputCache
; however, I would like to do server side caching as well as per parameter input.
According to some answers here and here, I should be using IMemoryCache
or IDistributedCache
to do this. I'm particularly interested in caching on controllers where the parameter is different, previously done in asp.net 4 with OutputCache
and VaryByParam
like so:
[OutputCache(CacheProfile = "Medium", VaryByParam = "id", Location = OutputCacheLocation.Server)]
public ActionResult Index(long id)
{
///...
}
How would I go about replicating this in asp.net core?