Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detection or Removal of Caching 1

Status
Not open for further replies.

Watts

Programmer
Jan 18, 2001
80
0
0
US
Is there any way to tell a HTML Page not to Cache? Which tag is it?

Also can I write a Javascript/Java Applet that detects if a page is cached and then do something? My page is changing on the fly using a CGI script but the actual content of the original doesn't change so IE still thinks it is the same and uses the cache version instead of going out to the server and obtaining a new one.
 
This meta tag should work.
<META HTTP-EQUIV=&quot;Pragma&quot; CONTENT=&quot;no-cache&quot;>

Mickey
 
I was told that this tag does not work for IE4 and 5, I tried it myself and couldn't get it to work. Has anyone got a solution that works with IE5?
 
Here you go, this is the cure-all for caching. The EXPIRES tells IE when to load a new version and the CONTENT=0 says to the browser that it needs a new version every time. This works, I am using it currently.

<META HTTP-EQUIV=&quot;expires&quot; CONTENT=&quot;0&quot;>

Doesn't anyone have an answer to the second part of my question.
 
hi
well, u might add current time or random number to the url, so, page wont be cachin..

<script>
var tmp=Math.floor(Math.random()*10);
top.location=&quot;mypage.html?&quot;+tmp
</script>


but i dont kno if u're able 2 check if ur page was cached..

regards, vic
 
Sorry Vic but I can not add anything to the URL...

There might not be a way, but what about this then? Is there some way to detect what the next URL is when someone leaves your web-page and if so how?
 
IE won't let you access a url when it's not part of your domain (it's a violation of security). I don't think NN will either. If the link to the off-domain url is on your page you may be able to do something with an onClick handler. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
That is okay, what I really want to know is whether or not the user has left my domain. So if I could detect this event I would be cool. I don't need to really know the next URL, just whether or not it is the same domain as the current URL.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top