Force reload of changed page?

N

Nige

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.
 
S

Stuart Palmer

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
 
N

Nige

<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?
 
T

Thomas 'PointedEars' Lahn

Nige said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top