How to Prevent Caching in ASP.NET MVC

Any page that potentially contain sensitive information should not be cached on the user's browser and proxy servers. In ASP.NET MVC, you can use the OutputCache attribute to prevent caching for a controller action. For example: This will result in the following headers: Cache-Control: no-cache, no-store Pragma: no-cache Expires: -1…