OutputCache无法处理页面加载(重新加载)

时间:2017-08-09 09:12:36

标签: asp.net-mvc

在我的MVC项目中,我使用OutputCache在服务器端和客户端缓存页面。每当我加载页面或重新加载页面数据不是来自缓存。对此有任何解释吗?

控制器:Main.cs

[OutputCache(Duration=3600)]
public ActionResult Main()
{
//some code
return View("~/Views/main.cshtml",DateTime.Now);
}

查看:main.cshtml

@model DateTime
<h2>Hi</h2>
<h2>Hello</h2>
<h2>@Model</h2>

0 个答案:

没有答案
相关问题