ASP.NET MVC4!
the code :
[OutputCache(Duration = int.MaxValue, VaryByParam = "id")]
public ActionResult Index(int id = 0)
{
return Content(DateTime.Now.ToString());
}
the code above working well. but the code:
public ActionResult Index(int id = 0)
{
ActionResult result = Test(id);
return result;
}
[OutputCache(Duration = int.MaxValue, VaryByParam = "id")]
ActionResult Test(int id)
{
return Content(DateTime.Now.ToString());
}
is not working!
i also try like this:
public ActionResult Index(int id = 0)
{
return Test(id);
}
it's also not output the same value each request!
You should use