469,929 Members | 1,837 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,929 developers. It's quick & easy.

Force reload of changed page?

I'm not sure if this is the right group, but I thought the solution may
be JS related, hence my post.

I've got a web site that is frequently updated; yesterday several
subscribers contacted me to say they couldn't see the update. I suspect
this is a cache problem, so is there a way to force a page to be
reloaded when it is changed. I realize it is too late for the current
pages, but I'd like to include something later.
--
Nige

Please replace YYYY with the current year
ille quis mortem cum maximus ludos, vincat
Jul 20 '05 #1
3 17571
Nige,
Don't think this is a JS question really, always useful to use search
engines to see if you can find the answer first. But try:-

<META HTTP-EQUIV="Expires" CONTENT="Tue, 01 Jan 1980 1:00:00 GMT">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">

it may help. Otherwise I know you can defo do it server side with asp
using:-

response.expires = 0

Hope that helps

Stu
"Nige" <uY***@ntlworld.com> wrote in message
news:7v********************************@4ax.com...
I'm not sure if this is the right group, but I thought the solution may
be JS related, hence my post.

I've got a web site that is frequently updated; yesterday several
subscribers contacted me to say they couldn't see the update. I suspect
this is a cache problem, so is there a way to force a page to be
reloaded when it is changed. I realize it is too late for the current
pages, but I'd like to include something later.
--
Nige

Please replace YYYY with the current year
ille quis mortem cum maximus ludos, vincat

Jul 20 '05 #2
In comp.lang.javascript, Stuart Palmer wrote:
<META HTTP-EQUIV="Expires" CONTENT="Tue, 01 Jan 1980 1:00:00 GMT">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">


Thanks, but I didn't really explain properly. I want to make sure that
my web content is reasonably current, but at the same time I don't want
to bypass caching completely.

I'm looking for a way to cache a page for 24 hours after a user accesses
it, but if they come back after that time, then reload the page.

I understand using HTTP headers, rather than META tags, is the best way
for maximum compatibility.

I've seen a few scripts in something called PHP, but I don't think I can
use this on my site.

Can anyone help, or offer an alternative?
--
Nige
--
Nige

Please replace YYYY with the current year
ille quis mortem cum maximus ludos, vincat
Jul 20 '05 #3
Nige wrote:
In comp.lang.javascript, Stuart Palmer wrote:
<META HTTP-EQUIV="Expires" CONTENT="Tue, 01 Jan 1980 1:00:00 GMT">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
Thanks, but I didn't really explain properly. I want to make sure that
my web content is reasonably current, but at the same time I don't want
to bypass caching completely.


"Wash it but don't make it wet." ;-)
I'm looking for a way to cache a page for 24 hours after a user accesses
it, but if they come back after that time, then reload the page.


Only server-side scripting can provide that reliably. You need the script
to set the Expires HTTP header and the `meta' element according to the
current date, i.e. the date the user accesses the document.
PointedEars
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Ike | last post: by
1 post views Thread by simon | last post: by
10 posts views Thread by riversmithco | last post: by
reply views Thread by tshad | last post: by
8 posts views Thread by T. Wintershoven | last post: by
7 posts views Thread by J055 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.