1

I know I can write a custom ActionFilter for an ASP.NET MVC Controller Action to set headers in the response that will disable caching.

My question is, is there an out-of-the-box ActionFilter in the MVC BCL that already does this? Or must I have to create my own custom one?

1

1 Answer 1

1

You can use the [OutputCache] filter:

[HttpGet]
[OutputCache(Location = OutputCacheLocation.None, NoStore = true)]
public ActionResult Index()
{
      // ....
      return View();
}

See MSDN

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.