PDA

View Full Version : Refresh



QuizToon
08-29-2005, 08:14 PM
Not sure if this is in the right place.

How do I make my webpages refresh automatically when they are loaded on a users pc.

I run a website which has a quiz via email. When I upload the new quiz and old answers etc, the users have to manually refresh their pages otherwise they see last weeks quiz and not the new one.

Any help would be appreciated

Thanks

ansar.ullah.s.khadri
08-30-2005, 03:48 AM
Hi Quiz
When some one is Opening a Website the Contents of the website are reloaded
Only the Offline content is Static and once connected it changes to the current changes on the website

can u please be a Lil more breif about the Question you have Submitted

Twey
08-30-2005, 11:20 AM
It's because it's been cached. Add:

<meta http-equiv="pragma" content="no-cache"/>
<!-- For HTTP/1.0-compliant browsers -->

<meta http-equiv="cache-control" content="no-cache"/>
<!-- For browsers that support HTTP/1.1 -->
to the <head> of any pages where this occurs.

mwinter
08-30-2005, 05:05 PM
Add:

<meta http-equiv="pragma" content="no-cache"/>
<!-- For HTTP/1.0-compliant browsers -->As a matter of interest, NN4 is about the only browser remaining in use that doesn't support HTTP/1.1. Roll on the death of NN4!

That said, I don't know about the state of proxies, but that's a separate issue and needs to be addressed again in a moment.



<meta http-equiv="cache-control" content="no-cache"/>
<!-- For browsers that support HTTP/1.1 -->
to the <head> of any pages where this occurs.Browsers do not have to respect meta elements that intend to represent HTTP headers. In fact the purpose of this type of use was so that servers could scan the head element of documents, looking for http-equiv attributes that it could translate into real headers.

Furthermore, even if meta elements were reliably respected by browsers, they aren't the only concern. People do use caching servers, and content providers like AOL move almost all data through these proxies (see AOL Caching Info (http://webmaster.info.aol.com/caching.html)). Therefore, if you need to control caching behaviour, you must do it properly via HTTP headers.


What the OP should really check is what expiry data (Expires header and Cache-Control: max-age= directive) is sent along with this quiz. In addition, do the validators (Last-Modified and ETag headers) change when the content changes.

Caching is beneficial to both authors and clients, and shouldn't be halted entirely unless really necessary.

Mike

Twey
08-30-2005, 05:15 PM
Browsers do not have to respect meta elements that intend to represent HTTP headers. In fact the purpose of this type of use was so that servers could scan the head element of documents, looking for http-equiv attributes that it could translate into real headers.
You live and you learn. :p
I don't agree with the "nobody uses this so let's not support it" idea, though. When it's a question of recoding the whole page or making it drastically less efficient for others, maybe one could not support it. When it's just a case of adding a few bytes to the page size, though, it's always worth it.