【发布时间】:2016-01-27 03:00:39
【问题描述】:
ResponseCache 在某种程度上替代了OutputCache;但是,我想做服务器端缓存以及每个参数输入。
根据here 和here 的一些答案,我应该使用IMemoryCache 或IDistributedCache 来执行此操作。我对在参数不同的控制器上缓存特别感兴趣,以前在 asp.net 4 中使用OutputCache 和VaryByParam 完成,如下所示:
[OutputCache(CacheProfile = "Medium", VaryByParam = "id", Location = OutputCacheLocation.Server)]
public ActionResult Index(long id)
{
///...
}
我将如何在 asp.net core 中复制它?
【问题讨论】:
-
你解决了吗?
标签: c# asp.net-web-api asp.net-caching asp.net-core-1.0