Way to have a site Auto-refresh when a user views it?

Soldato
Joined
4 Feb 2004
Posts
13,430
Location
Écosse
Just updated a website for my work. From the main PC at home I do my web design on, I opened up the updated site and viewed it, tested it all etc.

I then fired off an email to the person dealing with the supply of content for the site letting them know it had been updated and was essentially, finished.

Everything was fine but upon getting to work this morning, I got to work to find an email from the same person asking why I had sent an email to let them know it had been updated yet when they looked at it, it was still the same as last week?.

Instantly thought "Ahh....F5 key!!". :p

Called them up and got them to refresh their screen and lo and behold it worked. I guess some folk dont know about the need to refresh every so often.

Anyway, I've had a look at 4 other PC's connected to the same network and they all required refreshing in order to display the pages as updated.

Is there anything I can add in from my end, code wise within the XHTML that will check and refresh for updated pages on a users machine?.

Ta!!.
 
You'd need AJAX to get it working exactly as you described, and to be honest it probably wouldn't be worth the effort.

What you could do is make the page refresh at certain intervals by adding this to the <head> element:

Code:
<meta http-equiv="refresh" content="[B]n[/B]" />

Where n is how many seconds you want between refreshes.
 
Cheers for that. :)

Having "Googled" this issue, I'm wondering if I've actually used the wrong descriptive term as far as "Auto refresh" goes.

I would like a way for the site to check that the user has the latest updated pages in their browser cache and if not - load them in/refresh them to the updated ones.

Rather than "auto-refresh" at the users end every so often, which I could imagine may well get annoying?. I dunno, as I've never gave this much thought before!!!.

*EDIT* I think that might be what I'm looking for, Ladforce. :)

Any drawbacks to not allowing a users system to cache pages?. I would assume unless its a very slow connection, it wont be that noticeable that the pages have not been cached and are having to be loaded back in every time the user views it?.
 
Last edited:
<META HTTP-EQUIV="EXPIRES" CONTENT="0">

The date and time after which the document should be considered expired. An illegal EXPIRES date, e.g. "0", is interpreted as "now". Setting EXPIRES to 0 may thus be used to force a modification check at each visit.
Web robots may delete expired documents from a search engine, or schedule a revisit.

And

<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">

Any use?
 
The only problems with no caching is that search engine robots etc. may not bother to index your content as it will see the content as to transient. Also, users will have to download the entire page on every visit, slowing down their browsing.
 
Cheers guys.

Yeah, I suspected there may well be implications for SEO.

I'll have a think about it.

Thanks for your input. :cool:
 
Back
Top Bottom