View Full Version : Trouble with No-cache

12-31-2002, 06: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:



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.

12-31-2002, 07: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.

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

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

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

window.onload = function() {
if (!window.location.search) {
setTimeout("window.location+='?refreshed';", .5);
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">

This still does not work. Any ideas?

01-01-2003, 07: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.