2014-10-19 57 views
0

我想我的缓存页面,并使用这种类型的缓存如何在IIS和客户端上缓存页面?

[OutputCache(Duration = 21600, VaryByParam = "none")] 
    public ActionResult Index() 
    { 
      //some codes 
     return View(); 
    } 

,但我很困惑这种类型的缓存将存储在IIS或在客户端浏览器?

如何将用户浏览器中的页面缓存在服务器上?

回答

1

无处不在的asp.net缓存页面(服务器,代理,客户端)。您可以通过属性

[Output(Location=OutputCacheLocation.Any)] 

更改此您可以将位置属性设置为以下任一值:

  • OutputCacheLocation·任何
  • OutputCacheLocation·客户端
  • OutputCacheLocation.Downstream
  • OutputCacheLocation.Server
  • OutputCacheLocation.None
  • OutputCacheLocation.ServerAndClient