Link to home
Start Free TrialLog in
Avatar of semuel
semuel

asked on

Refresh an HTML page.

Hello there.

I have a script which updates HTML pages on my site.
But the users of the sites see the version on their cache and not the new updated one.

How can I force any new request for an updated page to get the new one, instead of the cached one?
Avatar of squimph
squimph

For netscape users, you can use a "no-cache" directive in the <HEAD> section of your HTML pages like this:

<head>
<meta http-equiv="Pragma" content="no-cache">
</head>

MS internet explorer uses something different (grr!). For MSIE, apparently you have to use something like this:

<head>
<META HTTP-EQUIV="Expires" CONTENT="Tue, 04 Dec 1993 21:29:02 GMT">
</head>

Notice the date in the above is already past. (I got this hint from http://www.microsoft.com/workshop/author/support/faq.asp)
Avatar of semuel

ASKER

Hello squimph.

It's a nice answer, but not what I've asked.
in your way, the browser will never use his cache, and always will refresh the page.

what I want is to cause the browser to compare the file's date, and if the file changed from the last time it was cached, it'll refresh.
of course, it's resnable to think that it'll happend anyway, but it's not the case.
I'm using netscape and Apache server.

thanks.
ASKER CERTIFIED SOLUTION
Avatar of squimph
squimph

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Actually, just use the expires tag (and Netscape does use the tag) the way it was originally supposed to be used.  Set the page to expire when you expect to have new code up.  (Yeah, I know, this requires planning ahead...)