问题
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