My application is primary run from mobile devices in the field with at times spotty internet connections. I keep getting reports from users that the they can access the login page but not the site. I have traced this back to a cached copy of the login page on there device. I want to force the browser not to cache a copy of some key pages which includes the login page. Doing some searching I found some methods that include appending the responce headers but there are so many different methods that only work on some browsers. I wanted to know if anyone has been down this road or done something similar to this?
Here is some ASP.NET Code that I found, some people report it works:
What I assume would be the equivilent alpha code using the Response.Headers.Set method:
Here is some ASP.NET Code that I found, some people report it works:
Code:
Response.ClearHeaders(); Response.AppendHeader("Cache-Control", "no-cache"); //HTTP 1.1 Response.AppendHeader("Cache-Control", "private"); // HTTP 1.1 Response.AppendHeader("Cache-Control", "no-store"); // HTTP 1.1 Response.AppendHeader("Cache-Control", "must-revalidate"); // HTTP 1.1 Response.AppendHeader("Cache-Control", "max-stale=0"); // HTTP 1.1 Response.AppendHeader("Cache-Control", "post-check=0"); // HTTP 1.1 Response.AppendHeader("Cache-Control", "pre-check=0"); // HTTP 1.1 Response.AppendHeader("Pragma", "no-cache"); // HTTP 1.0 Response.AppendHeader("Expires", "Mon, 26 Jul 1997 05:00:00 GMT"); // HTTP 1.0
Code:
Response.Headers.Set("Cache-Control", "no-cache") 'HTTP 1.1 Response.Headers.Set("Cache-Control", "private") 'HTTP 1.1 Response.Headers.Set("Cache-Control", "no-store") 'HTTP 1.1 Response.Headers.Set("Cache-Control", "must-revalidate") 'HTTP 1.1 Response.Headers.Set("Cache-Control", "max-stale=0") 'HTTP 1.1 Response.Headers.Set("Cache-Control", "post-check=0") 'HTTP 1.1 Response.Headers.Set("Cache-Control", "pre-check=0") 'HTTP 1.1 Response.Headers.Set("Pragma", "no-cache") 'HTTP 1.0 Response.Headers.Set("Expires", "Mon, 26 Jul 2010 05:00:00 GMT") 'HTTP 1.0
Comment