Created
November 8, 2013 13:32
-
-
Save n3dst4/7371087 to your computer and use it in GitHub Desktop.
Disabling absolutely all caching on an ASP.NET MVC controller action. Because this is always so much ballache.
This file contains hidden or 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
| Response.Cache.SetExpires(DateTime.UtcNow.AddDays(-1)); | |
| Response.Cache.SetValidUntilExpires(false); | |
| Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches); | |
| Response.Cache.SetCacheability(HttpCacheability.NoCache); | |
| Response.Cache.SetNoStore(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment