Here's an odd one, for me at least. I'm reading an image into a cf image variable and saving it as a session variable:
<cfimage action="read" source="myPath/image.jpg" name="myImage" />
<cfset session.image = #myImage# />
I plan to be manipulating that image at some point, which is why I'm saving it to a variable. Anyway, then I stream it with cfcontent:
<img id="photoPlaceholder" src="/#application.root_name#/administration/PhotoManagement/displayPhoto.cfm" width="500px" />
from template displayPhoto.cfm:
<cfcontent variable="#imageGetBlob(session.image)#" />
Here's the problem. After the first call, the first retrieved image is displayed no matter which new image is passed to it. I've tried destroying the session variable before the cfimage tag, and I've verified that I'm passing the correct image variable each time. The only way a new image is shown is if I refresh the page.
It seems to me that cfimage is somehow caching the image, and each new call to it doesn't refresh the variable myImage. CF documentation says nothing about this, and google brought up nothing.
Thoughts?
Your problem is probably client-side. Since the URL in your img tag doesn't change (...displayPhoto.cfm), your browser doesn't see that you are in fact pointing to a new image, so it keeps serving up the image already in cache.
You might try adding a randomized fake parameter to the end of your src attribute, something like this pseudo code:
<img id="photoPlaceholder" src="/#application.root_name#/administration/PhotoManagement/displayPhoto.cfm?somevar=#aUniqueValue#" width="500px" />
You could create the aUniqueValue variable from a random number generator or timestamp generator.