tags:

views:

1508

answers:

2

What is the proper (browser agnostic) way to disable page caching in ASP.NET MVC?

+1  A: 

From http://www.i18nguy.com/markup/metatags.html:

<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">

Goes in your view and should tell browsers to not cache the page.

BTW, this wouldn't be an ASP.NET MVC specific thing.

ajma
+9  A: 

Try this:

[System.Web.Mvc.OutputCache(NoStore = true, Duration = 0, VaryByParam = "*")]
public ActionResult NonCacheableData()
{
    return View();
}
DSO