Click to See Complete Forum and Search --> : Cache busting


leonardo43
12-06-2003, 02:05 AM
I'm looking for code that refreshes a page on opening (onLoad) and refreshes from the URL server and not a forced cache copy on a proxy server.

Alternatively, code that "pushes" from server after a specified time on line, say 1000ms, that will update the page. This code could call a Perl CGI script to force a refresh. I can write simple Perl.

My problem is that a site I run is updated daily, but I fear users don't always get the new content.

Can anyone help or suggest?

96turnerri
12-06-2003, 05:27 AM
try <body onload="javascript:history(0);">

Daria
01-08-2004, 02:31 PM
BTW,
works in Mozilla,
doesn't in IE

Daria
01-08-2004, 03:56 PM
how to modify so it can in work in all?

96turnerri
01-08-2004, 04:16 PM
history.go(0)

Daria
01-08-2004, 07:59 PM
Perfect. Thanks.

fredmv
01-08-2004, 08:09 PM
<script type="text/javascript">
//<![CDATA[
onload = function()
{
setInterval(function() { location.reload(true); }, 1000);
}
//]]>
</script>

Daria
01-08-2004, 08:40 PM
OK, Sorry for premature enthusiasm on my part. I can actually see them loading in both cases. (jumping effect) I don't need a permanent refresh, but rather what subject suggests.

pyro
01-08-2004, 10:30 PM
Try some code like this to force the page not to load from the cache:

<meta http-equiv="cache-control" content="no-cache, must-revalidate">
<meta http-equiv="pragma" content="nocache">

Daria
01-08-2004, 10:46 PM
This works fine first time around. If I do it more then once, I have to do every next time manually.