Auto refresh?

Status
Not open for further replies.

Snake-Eyes

Daemon Poster
Messages
1,147
My father has an HTML-based website and he is constantly making changes. If he were to make changes, and publish the page while someone is viewing that page, and they don't hit refresh, they won't see the changes. Is there any way using HTML or something to make an auto-refresher kind of tool?
 
That is similar. I'm looking for one where it doesn't grab the page out of cache, but still refreshes or would that be too slow? We want to have the page refresh every time it is newly accessed, rather than grabbed out of the cache and using the un-updated version of that page.

We want to refresh the page but not slow the page down for dial-up users and the like.
 
Clarification: How can we make the page be pulled from the web every time instead of from the cache on the user's harddrive?
 
Hmm, I dont know what to tell you. I would think that putting a refresh thing on the page would be annoying, and slow it down even more for dial-up users. Is it really necessary? How often do you make changes to it, and are they really that important?
 
We make changes about 3 times a week. I, personally, do not know the exact importance of it, but my father seems to think it's really important.

Hmm, well, thanks for your time and help.
 
I know you said your father is working in HTML, but if its extremely important, you should be able to achieve this using PHP:

http://www.edginet.org/techie/website/http.html#EXP

Just send an invalid HTML "Expire" header, and this will force the browser to keep the page out of the cache. Whenever someone loads the page, it will force it to refresh.
 
Taken from: http://www.codeave.com/html/code.asp?u_log=5080

<html>
<head>
<meta http-equiv="Pragma" content="no-cache">
<!-- Pragma content set to no-cache tells the browser not to cache the page
This may or may not work in IE -->

<meta http-equiv="expires" content="0">
<!-- Setting the page to expire at 0 means the page is immediately expired
Any vales less then one will set the page to expire some time in past and
not be cached. This may not work with Navigator -->

<title>CodeAve.com(No Cache)</title>
</head>
<body bgcolor="#FFFFFF">

<!-- There are two basic ways to prevent a page from
going into cache. Either one should work in the majority
of browsers. As with most meta tags they should be placed within
the head tags of your document -->

</body>
</html>

That is two methods of preventing the use of cache...

For refreshing--you can use simple Javascript and put a timer to "auto-refresh" every so often, such as:

<script language="javascript" type="text/javascript">
// the time is in milliseconds, so if you want it every day, it'd be: 1000 ms * 60 s * 60 m * 24 h = 86400000 d (one day)
setTimeout('document.location=document.location', 10000);
</script>

Note: you don't want to do this if 1. you have a lot of images AND you have dial-up users browsing (unless its only once every X days, or so) or 2. you are worried about your bandwidth.

If you wanted, you could use frames...and set only a specific frame to not cache, and auto-refresh.

There's also a million other ways...if I didn't say how to do something you wanted...or you want another way, let me know :D
 
This may be a stupid reply but... I think it has to do with the MIME types that the server has associated with it as to whether or not caching is used... a .PHP file should never be loaded from local cache, as far as I know. So you could just make a PHP file and not use any actual PHP in it, if your server supports it.
 
Props to Xula. My father found that site while he was at work. Thanks for your help, though! Honestly appreciated!
 
Status
Not open for further replies.
Back
Top Bottom