Forum Moderators: open

Message Too Old, No Replies

Force the Browser to check for updates?

         

Cienwen

8:43 pm on Jun 1, 2006 (gmt 0)

10+ Year Member



Hello everyone,
I have a website that changes it's homepage image ever 6 weeks. Many of my viewers have to hit there refresh button in order to see the new images. Their browsers always load their cached version.
Is there anyway to force the browser to check for updates? I am open to other coding types, Javascript, Perl and PHP. Just about anything at this point.
Any ideas anyone?

eelixduppy

3:26 am on Jun 2, 2006 (gmt 0)



Using php, it goes like this:
<?php
header("Cache-Control: no-cache, must-revalidate");
?>

kaled

8:50 am on Jun 2, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Delivering the images with an expires http header might be appropriate if you know in advance the precise date/time the images change.

Kaled.

eelixduppy

10:19 am on Jun 2, 2006 (gmt 0)



How about this, taken from php.net:
<?php
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
?>

Cienwen

4:49 pm on Jun 2, 2006 (gmt 0)

10+ Year Member



I will give that a try. Thanks for the input.