views:

887

answers:

3

I read that when you don't have access to the web server's headers you can turn off the cache using:

<meta http-equiv="Cache-Control" content="no-store" />

But I also read that this doesn't work in some versions of IE. Are there any set of <meta> tags that will turn off cache in all browsers?

+1  A: 

pragma is your best bet:

<meta http-equiv="Pragma" content="no-cache">
Crimson
+4  A: 

It doesn't work in IE5, but that's not a big issue.

However, cacheing headers are unreliable in meta elements; for one, any web proxies between the site and the user will completely ignore them. You should always use a real HTTP header for headers such as Cache-Control and Pragma.

bobince
@bobince, Thanks! I'll keep this in mind if I have any issues with web proxies, but my "team" keeps me completely on the front-end and give me no access to the headers.
leeand00
+5  A: 
<META HTTP-EQUIV="Cache-Control" CONTENT="max-age=0">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META http-equiv="expires" content="0">
<META HTTP-EQUIV="Expires" CONTENT="Tue, 01 Jan 1980 1:00:00 GMT">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
dpb
There's no special reason the third tag is in the lower case is there?
Matthew Lock
No special reason. Although you have to consider other things such as your DOCTYPE declaration, or maybe using HTML vs XHTML.
dpb