image caching problem using php

liunx

Guest
Hello,

I am having some problems with my browser caching images. I am using php. I have a product database that keeps track of info and images. When editing a image of a particular product, if you change the image, the old picture gets displayed until a refresh. The image keeps the same name so the browser is just grabbing it from the temp files. I have tried the following header();, and meta attempts below to stop this but no luck. Only thing that works is to set IE to "Every Visit to the Page" and I would like it to work on all settings.

Any suggestions??????

--------------------------------
header("Date: ".gmdate('D, d M Y H:i:s \G\M\T', time()));
header("Last-Modified: ".gmdate('D, d M Y H:i:s \G\M\T', time()));
header("Expires: Mon, 20 Dec 1998 01:00:00 GMT");
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header( "Pragma: no-cache" );
------------------------------
echo('<head>');
echo('<META HTTP-EQUIV="Pragma" CONTENT="no-cache">');
echo('<META HTTP-EQUIV="Expires" CONTENT="-1">');
echo('</head>');nope, those don't work. IE doesn't really understadn pragma. you will have to change teh name or set you IE to "every visit" which in all reality should be that anyway.Thats pretty lame. Well I guess I will just tack the time or a random number onto the end of the file name. Thanks for the info.
 
Back
Top