Jump to content

Stop Browser from Caching a Dynamicly Generated Image?


Raine Dragon

Recommended Posts

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.