How Can I Disable Browser Caching for a Web Page?
Use these to jump around or read it all…
[Pragma Doesn’t Work in IE 5]
[ASP Pages Use This]
I get letters now and again asking how to make it so that when a page is loaded into a browser, that page will not be loaded into the browser’s cache. Someone would want to do this for a few different reasons. First, if the page contains information that will be readily updated through a refresh command of some sort, you don’t want a page in cache to thwart the process. You want the page to be reloaded from the server each time.
Another big concern is when someone is filling out forms. You really don’t want the pages cached because if they are, credit card numbers and addresses and all kinds of stuff can be gathered from the cached page.
When people talk about not caching a page, the talk of this command usually comes up:
<META HTTP-EQUIV=”Pragma” CONTENT=”no-cache”>
The old statement was always, plop that between your head commands and you’re good to go. No cache! Well, that’s just not the case. There are bugs in both Netscape Navigator (NN) and Internet Explorer (IE).
So, if you’re really interested in not caching a page, read on.