Forum Moderators: open

Message Too Old, No Replies

prevent caching

         

webaster

10:08 pm on Mar 16, 2005 (gmt 0)

10+ Year Member



In theory if i would use ie comments would this extra head tag be ok

<META HTTP-EQUIV="Expires" CONTENT="-1">

That sets an immediate expiration on the file. Thus it dies the moment is it born. Place it on your page in the same manner as above. Since you still have the 64k buffer problem to worry about, I would place it in both HEAD tag sections. Better to be safe than sorry. It should look like this:

<HTML>
<HEAD>
<TITLE>---</TITLE>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
</HEAD>
<BODY>

Text in the Browser Window

</BODY>
<HEAD>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
</HEAD>
</HTML>

tedster

4:29 am on Mar 17, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



From what I understand, the proper content for the "expires" meta tag is either "0" [meaning now] or a full date in GMT - such as Wed, 16 Mar 2005 09:30:00 GMT. To be understood by the widest variety of browsers, old and new, these three meta tags cover all the bases:

<META HTTP-EQUIV="Expires" CONTENT="0">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">

As an aside, the <head> element should be unique on a page - that is, there should not be two <head> tags, only one. See this W3C reference for more:
Global Structure of an HTML Document [w3.org]

webaster

11:12 am on Mar 17, 2005 (gmt 0)

10+ Year Member



meta tags dont work only server-side cache settings

webaster

11:18 am on Mar 17, 2005 (gmt 0)

10+ Year Member



<META HTTP-EQUIV="Pragma" CONTENT="no-cache"> works in IE5 and above and only on secure pages https

and Ie only caching works if 64K is in the buffer of cache that's why -IE caching is only full proof when using server-side http headers sent with asp-php

<META HTTP-EQUIV="Expires" CONTENT="-1">