View Full Version : HTML problem

10-11-2005, 06:56 PM
I got a website with a NEWS page that I update daily. The problem is that you have to click on the refresh button of your browser to see the changes... I'm suspecting that most of my readers don't do that and end up reading out-of-date stuff... is there an HTML tag or something I can do so that the page is refreshed everytime someone views that page?

10-11-2005, 07:51 PM
Put this tag in the <head></head> section of your page

<META HTTP-EQUIV=Refresh CONTENT="300;yourpage.name">

The 300 is the number of seconds to wait before refreshing

10-11-2005, 08:32 PM
Does that mean that when the users go on the page it will take 300 secs before it refreshes?

I need it to refresh straight away (bypass the cache). And it only need to be refreshed once per visit...

10-11-2005, 08:58 PM
Try this:

<font class="small">Code:</font><hr /><pre> // HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);

// HTTP/1.0
header("Pragma: no-cache");
</pre><hr />

So, in your webpage just put this:

<font class="small">Code:</font><hr /><pre>&lt;?
header("Cache-Control: no-store, no-cache, must-revalidate");
</pre><hr />
And it should not store it in the cache...

10-12-2005, 08:56 AM
Here's an article on preventing caching: So, You Don't Want To Cache, Huh? (http://www.htmlgoodies.com/beyond/reference/article.php/3472881)