Stopping pages from being cached.


A

Adrian Parker

IE.. Tools -> Internet Options -> Settings Button ->
Check for newer versions of stored pages = Never

If a user changes thier settings to this, then pages are cached in IE.

From what we've found, you have to use the following Meta tags in the HEAD
section to stop it doing it.

meta http-equiv="Pragma" content="no-cache"
meta http-equiv="Expires" content="0"

However, due to a nice feature, if the page is less than 64k, you have to
add a 2nd HEAD section after the BODY and include the two meta tags again.
e.g.

<HTML>
<HEAD>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
</HEAD>
<BODY>
yada yada yada
</BODY>
<HEAD>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
</HEAD>
</HTML>

else the pages are still cached.

To get the thing working and out there, I've added the 2nd head tags to each
aspx page.

Is there a better way of doing this?

Thanks
Adrian
 
Ad

Advertisements


Top