views:

41

answers:

1

We are currently having an issue with cache settings on a shared workstation at one of our client sites. Basically, they had set their IE browser on their machine to "never" for when to check for new versions of a site. This causes some of our pages to show another user's data after one user logs out and logs back in. What are my options to prevent this type of behavior, aside from telling the users to not use that setting (which we can never really guarantee). The site is an asp.net 3.5 site.

I know one option is to set the page to never cache, but that will also cause users to lose the back button functionality on a lot of the site. So any other options would be helpful.

+1  A: 

If you set caching to be on (from the server) you won't loose back button functionality, its just that clicking the back button will make a new request to the server rather than just displaying the page from cache. This is more secure, because it means if someones signs-out, another user can't click back to see what they had on their screen previously.

JonoW
When you say "set caching to be on from the server", how exactly is that done? Also, would this method cause a postback to occur on things like form submission when hitting back?
x x
In a particular ASPX pages code-behind, you could do:Response.CacheControl = "no-cache";Response.AddHeader("Pragma", "no-cache");Response.Expires = -1441;The back button wouldn't cause post-backs, it would simple make a GET request to the URL on the previous page.
JonoW