Re: Dynamic Images

From: Date: Wed, 02 Aug 2006 13:40:33 +0000
Subject: Re: Dynamic Images
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-239987@lists.php.net to get a copy of this message
At 6:08 PM +0530 8/2/06, Manoj Singh wrote:
Hello all, I am creating a a script in which a dynamic graph is generated through gd library. The format of the picture is jpeg. Now the problem is that the browser is caching the images and after updating also it is displaying the older image. Currently for clearing the cache i am using this code <?php header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: no-cache"); header("Pragma: no-cache"); ?> But this code is not working me. Please help me. Regards Manoj
Manoj: I had a similar problem -- if memory serves me correctly, I solved it by appending a random string to the jpg, such as graph.jeg?id=<some random string>. The image tag won't process the addition and the browser treats it as a new image. I think this worked for most browsers, but I may be wrong. tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com

« previous php.general (#239987) next »