...

View Full Version : Trouble with No-cache



jason7655
12-31-2002, 05:30 PM
Is there a way to set a password protected page to not cache in a user's browser without making changes to the server settings.
I've tried all the meta tags that I can find, such as:
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="no-cache">
<meta http-equiv="Expires" content="-1">
<meta http-equiv="Cache-Control" content="no-cache">

And I've also found the following documents pertaining to it:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;234067

http://support.microsoft.com/default.aspx?scid=KB;en-us;q222064

We are running an old version of Iplanet as a webserver and I don't want to make any changes on that.

I want the page that is password-protected to expire immediately from the user's cache. No code that I've found yet will make that happen.

Any help would be appreciated.
Jason

chrismiceli
12-31-2002, 06:18 PM
the meta no cache tags are very non cross browser and ineffective.


Originally posted by beetle
Most still use them...except for Google. They make up their own. This is the site description you see when searching. Like I said before those cache tags probably won't work because most servers disable them now-a-dayz. The most reliable you can do is use both the cache tags & refresh once to update with js:

This is set for half a second (.5)...Use 1000 for one sec, 5000 for 5 seconds, etc.

<script>
window.onload = function() {
if (!window.location.search) {
setTimeout("window.location+='?refreshed';", .5);
}
}
</script>

Title, meta description, then meta keywords.

SE's can't read javascript. Ha! ha! But they don't need to in order to revisit your updated site.

i got that from here
http://codingforums.com/showthread.php?threadid=11299&highlight=no+cache

jason7655
12-31-2002, 06:24 PM
I put that in there....Here is the portion of code:

<html>
<head>
<script>
window.onload = function() {
if (!window.location.search) {
setTimeout("window.location+='?refreshed';", .5);
}
}
</script>
<title>dadadada</title>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="0">

This still does not work. Any ideas?

brothercake
01-01-2003, 06:43 AM
I use a PHP method - adding these headers to the top of a page, before <html>



<?
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
?>


This creates a non-caching page by setting an expiry date in the past.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum