Raine Dragon Posted July 24, 2009 Share Posted July 24, 2009 Alright, so I'm using ImageMagick to make an image based on information in a database. So the user submits data, it's written to the database, and then read out again and processed by imagemagick which then writes the image to the server. The resulting page then displays the modified image. Unfortunately, the image is caching, so when the user views the result page, they have to do a hard refresh to see the updated image, which will not work for what I'm trying to do. So, I don't want that single image to cache, but the site and the results page are image heavy; I want the other images to cache because the loading time would be ridiculous if they all had to download every time. I've googled it, but all I can find are ways to stop caching the contents of a whole page. Any suggestions? Pretty sure this isn't really much help in this instance, but some code.. Image Processing //Process the image exec("convert -size 200x250 xc:white \ ".$gatherparcels." \ -flatten avatars/".$useravi.".png"); exec("convert avatars/".$useravi.".png -transparent white avatars/".$useravi.".png"); //where $gatherparcels is a dynamically generated string with a one or more instance of the following code snippet with varying file names : -page +0+0 2.png the image is displayed in a standard HTML image tag with the image name and path being dynamically generated by the php page. Link to comment https://forums.phpfreaks.com/topic/167303-stop-browser-from-caching-a-dynamicly-generated-image/ Share on other sites More sharing options...
rhodesa Posted July 24, 2009 Share Posted July 24, 2009 add a key to it, so it doesn't cache: <img src="path/to/image.php?_=<?php echo time(); ?>" /> Link to comment https://forums.phpfreaks.com/topic/167303-stop-browser-from-caching-a-dynamicly-generated-image/#findComment-882159 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.