Sometimes a problem doesn’t have to be hard to fix…
Last week I was looking to disable browser caching for a specific action method on an ASP.NET MVC controller. There are multiple ways to do this. I decided to take the ActionFilter attribute road:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SomeController:Controller | |
{ | |
[OutputCache(NoStore = true, Duration = 0, VaryByParam = "None")] | |
public ActionResult NoCache() | |
{ | |
return View(); | |
} | |
} |