Can I force MVC to get a new page?

非 Y 不嫁゛ 提交于 2019-12-08 10:50:17

问题


I am using code like this:

[OutputCache(Duration = 86400, VaryByParam = "none")] 
public ActionResult Index() {
}

Everything works well BUT there are times when I would like to force MVC to get a new page when I do a redirect to the index page using:

RedirectToAction("index", "home");

Is this possible? Is there some way that I can invalidate the cache?


回答1:


You could try something like:

HttpResponse.RemoveOutputCacheItem("/Home");


来源:https://stackoverflow.com/questions/7404261/can-i-force-mvc-to-get-a-new-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!