Forum Moderators: open

Message Too Old, No Replies

Automatically Refresh a Page

Well... how do I?

         

paste

3:58 pm on Apr 5, 2004 (gmt 0)

10+ Year Member



Basically, I have a page that gets visited, usually more than once by a client, but the information on it gets updated and often won't show up unless the client refreshes their browser. What can I do to make the page refresh *once* each time it's visited? I'd be fine just using html to do this, but keep in mind that the page also uses Perl, so if anyone has a perlwise solution, that would be helpful also. Thanks

-eric

Alternative Future

4:07 pm on Apr 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<META HTTP-EQUIV="Pragma" CONTENT="no-cache">

This will tell the broswer not to cache the page, so in effect would force a fresh page each visit.

Is this what you are after?

-George

paste

4:13 pm on Apr 5, 2004 (gmt 0)

10+ Year Member



Yes and no. I already have that line, along with:

<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">

but it still is cached by many browsers, for example, mine: IE6.

-eric

Alternative Future

4:16 pm on Apr 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How about:

<META HTTP-EQUIV="Expires" CONTENT="Tue, 01 Jan 1980 1:00:00 GMT">

Not sure on the workings of these but thought they would have done what you were after...

-George

paste

4:18 pm on Apr 5, 2004 (gmt 0)

10+ Year Member



let's see... i also had:

<META HTTP-EQUIV="expires" CONTENT="now">
<META HTTP-EQUIV="expires" CONTENT="0">

also to no avail.

what i'd really like is just something that would refresh the page once, each time it's visited in a browser

-eric

Alternative Future

4:27 pm on Apr 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well that about cover the options in HTML meta tags :)

Here is a little javascript that will force a page to refresh each visit:

<script language="javascript">
function reload(){window.location.reload();}
</script>

<body onload="reload()">

Does that work for you?

-George

Alternative Future

4:31 pm on Apr 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



oops that goes into an infinite loop...

My mistake:)

Try this one:

<body onload=window.refresh>

-George

paste

4:33 pm on Apr 5, 2004 (gmt 0)

10+ Year Member



Yes and no.

It reloads it, but as soon as it's reloaded, it reloads it again... and again... and again...

-eric

Alternative Future

5:00 pm on Apr 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How about the second one?

-George

paste

5:08 pm on Apr 5, 2004 (gmt 0)

10+ Year Member



oh, i completely missed that one ;]

but no, that one doesn't seem to refresh it at all.

-eric

brucec

6:36 pm on Apr 5, 2004 (gmt 0)

10+ Year Member



George, you said to use:

<script language="javascript">
function reload(){window.location.reload();}
</script>

This is ok, but i people turn off their javascript settings.

Purple Martin

11:15 pm on Apr 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Maybe it's not your browser that is caching the page - maybe you're in a corporate environment and there is a corporate cache, or maybe it's your ISP doing the caching.