In my application, I have an Image control that I am using for an application-wide image.
Then user is allowed to upload this image to the server and it is saved with a set filename, for example "ApplicationImage.png" I was having trouble getting the Image to update when a new image is selected and uploaded to the server. This is because the source property is set to the same filename and the image was not reloading. I have seen posts elsewhere that explain that the browser caches the response it got from the first call you make when the image source property is set. To prevent this caching, you append a unique value to the end of the source path. For example, myImage.source = 'myPath/ApplicationImage.png?param="+(new Date()).getTime); This works for the most part but there appears to be a timing issue. If I select an image to upload, it uploads fine to the server, then in my complete handler where I get the response back from the server I reset the image .source property to the filename again and append the date value to trigger a refresh and the image loads with the selected value. But if I initiate this process over again, then image just stays to the old value. The source actually has been reassigned (because if I refresh the new image will be there) but the image has not been reloaded or refreshed. If I wait a good 5 seconds between each attempt to upload a new image, then the image will always be correctly updated to the newly selected one. How do I force the image to refresh every time? What is this strange timing issue that caches the old image value even though I am setting the source property to a unique value? Is there a way to prevent the image from caching or is there some timout value that can be set?

