Click to See Complete Forum and Search --> : how to clear cache in PHP
rafiqasad
08-08-2007, 09:13 AM
Hello all.
I want to know how to clear cache in PHP. I am updating a image from admin panel. But after uploading old images displays. When i refresh the page then the new image dispaly. Can any one solve this problem. Thanks in advance
ellisgl
08-08-2007, 09:11 PM
You can try doing a meta refresh.. Bring up another page that has the meta refresh code that says "Please wait.." and go back to the page you want to be at. I'm not saying that's 100% solution thou.
knowj
08-09-2007, 02:46 AM
you can set the headers of the page not to cache this is used a lot of captcha
// Date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// always modified
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
// HTTP/1.0
header("Pragma: no-cache");
I don't know if this will stop the image problem tho. as these headers usually go onto the image itself (php generated image)