...

View Full Version : How do I clear the cache



earni23
03-12-2010, 02:29 PM
Hi
Iīm trying to load a picture on my website, but when I remake the picture the browser shows the old one. How do I solve this? I think the problem lies in the cache: how do I clear it?

Nightfire
03-12-2010, 02:33 PM
<?php
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
?>

abduraooft
03-12-2010, 02:33 PM
Check Example #2 at http://php.net/manual/en/function.header.php

earni23
03-12-2010, 02:46 PM
tried that, but it didnīt work!!

Nightfire
03-12-2010, 02:50 PM
Add a querystring on the end of the image path


<?php
$nocache = rand(0,1000);
?>
<img src="image.png?<?php echo $nocache; ?>" />

earni23
03-12-2010, 02:55 PM
itīs no the best solution, but it works!! Thz!!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum