I think what you want is to stop the browser from caching you page. This can be done with a meta tag in the head section:
HTML Code:
<meta http-equiv="PRAGMA" content="NO-CACHE">
Unfortunately this is not enough for IE since it caches in a different way. The solution (from Microsoft Support) is to add extra head tags between the </body> tag and the </html> tag where you insert the same code. The entire page should then look something like this:
HTML Code:
<html>
<head>
<meta http-equiv="PRAGMA" content="NO-CACHE" />
<title>Untitled Document</title>
</head>
<body>Body content of the page
</body>
<head>
<meta http-equiv="PRAGMA" content="NO-CACHE" />
</head>
</html>
Of course, this will not validate because of the extra head tags. There might be other ways to do this, but I think this is the simplest one.
Edit: I forgot that IE5 doesn't accept PRAGMA so you need to use this to prevent IE5 users from caching your page:
HTML Code:
<meta http-equiv="Expires" content="-1" />
That makes the page expire the moment it's created. The final code would then be:
HTML Code:
<html>
<head>
<meta http-equiv="PRAGMA" content="NO-CACHE" />
<meta http-equiv="Expires" content="-1" />
<title>Untitled Document</title>
</head>
<body>Body content of the page
</body>
<head>
<meta http-equiv="PRAGMA" content="NO-CACHE" />
<meta http-equiv="Expires" content="-1" />
</head>
</html>
I'm not sure if you need this IE5 meta tag in the first head section but it's better to be safe.
Bookmarks