logo META for Automatic Refreshing and Forwarding


Code for Page Refresh

You can use <META ...> to tell the web browser to automatically move to another web page, or refresh the current page, after a specified period of time.

To have the page automatically refresh itself every x seconds, use a tag like this:

<META HTTP-EQUIV="REFRESH" CONTENT="5">

This tells the browser to refresh the page (HTTP-EQUIV="REFRESH"), and that it should do so every five seconds (CONTENT="5").

Code for Page Forwarding

Suppose, however, that you want the page to refresh itself by going automatically to another page. This is common, for example, when someone has moved their home page to a new location, but want someone who goes to the old location to still find a pointer. You could put this <META ...> tag in the page at the old location:

<META HTTP-EQUIV="Refresh" CONTENT="5; URL=autoforward_target.html">

In a situation like this, you should also provide a regular link to the new page.

Code for Block Page Cashing

You can also use <META ...> tags to ensure that the browser does not cache the HTML document. Caching is the process of saving the HTML document locally, on the computer's hard drive, for future use so the browser doesn't have to download the document again. To ensure that the browser does not cache a particular page use the following code:

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