The CUCAT logo. A cat with the stars of the Southern Cross on it over the letters CUCAT.

Avoiding Auto Refresh


Can you imaging trying to read a book in which, periodically and without warning the page "refreshed" it self and caused yo to have to re-find what you are reading? For some reason some web page designers have take to doing just that. Take for example the website perthnow a site of a major daily newspaper in Perth, Western Australia. The page refreshes every four minutes. This is a bad practice for both sighted and blind users.

Overall the practice of automatically refreshing content web pages is simply a poor practice and should be avoided.

How and why of refreshing web pages

Originally page refreshing was envisions for simple pages whose content was updated on the server at regular intervals. If such a page was very simple and could be read by anyone quickly and if the content indeed did change often this was a reasonable approach to take. The other application is a notice page that is telling the user that a page he has requested has moved and after a short pause loading the new page.

In the case of perthnow and other papers such as the Herald Sun which employ the practice the attempt is to suggest that they are updating the page every few minutes and to ensure the reader has the latest version of the page. In practice however I have found that neither paper is updating at any thing close to the rate of every four minutes.

refreshing is done with a meta tag placed in the head section of the page here is the example from perthnow: <meta http-equiv="refresh" content="0240"> the first part of this tag: http-equiv="refresh" is telling the page to refresh itself while content="0240" is the time interval in seconds or in this case 4 minutes (240/60 = 4)

What to do about it

Ideally we wouldn't have web pages refreshing themselves at all. Would you want a book that turned its own pages? But if the designers of these web pages feel that they must have this feature they should provide a means of turning it off. I have provided a sample page which does this.

In the case of this sample I did this with PHP the code for which is below with comments:

$rval = "off"; //set the default state to off.
//get the value the URL passed to the page.
$reload = $_GET['reload']; 
if ($reload == "off") {
	$refresh = ""; //set the meta refresh to nothing.
	$rval = "on"; //change the word and value in the link.
} else {
	//set the meta refresh to refresh the page in 60 seconds.
	$refresh = "<meta http-equiv=\"refresh\" content=\"0060\">";
	$rval = "off"; //change the word and value in the link
}	

When the user click on the link the script set the meta tag to either start reloading the page every 60 seconds or sets it to no meta tag at all and then set the value of the link and the link wording to on or off as the case indicates. Using this or a similar JavaScript approach would give the user control over the refresh permitting him to turn it off if needed.

Greg Kearney, April 2008