【发布时间】:2016-05-05 07:17:51
【问题描述】:
我需要缓存特定于登录用户的页面。所以我使用如下所述:
[OutputCache(Duration = 10, VaryByParam = "Id", Location = OutputCacheLocation.Client)]
public ActionResult PartialPageOutputCaching(string Id)
{
return PartialView("PartialPageOutputCaching");
}
OutputCacheLocation.Client 对我不起作用,因为它每次都在服务新请求。我试图搜索特定于用户的存储页面输出缓存,但找不到正确的工作示例。请告诉我,OutputCacheLocation.Client 应该如何工作。
我尝试了 VaryByParam = "Id" 假设,基于操作方法参数的页面内容将被缓存,但看起来它适用于查询字符串参数。请确认 VaryByParam 的工作原理。
提前致谢。
【问题讨论】:
标签: asp.net-mvc caching