View Full Version : elements background image cache issue

11-12-2009, 02:47 AM
Ok this is going to be hard to explain I already know, so this is the only reason I created a video demonstration of the issue I am having down below.

Video of my issue. ("") [link is now closed]

I am creating an application and right now I am developing a feature that allow a person to do the following:

Upload picture
Draw a crop box on the image
Set cropped version of image to the background of different elements via DOM / CSS.

Here is the kicker, I have created a way to allow the person to simple adjust the crop box and upon completing an adjustment the app sends out a request to server side to capture and create a new copy of the image via httprequests. So each crop box adjustment = new request to recapture capture crop box selection and save out a new copy of the image.

Upon each request I send out to update the cropped image I await for a call back from server side. Once it gets this call back I then strip the element of question from its already set background only to then re-set the new cropped version back into the elements background.

My problem is upon taking down and putting back the newly cropped version of the image, no new updated cropped image version get displayed in the background of the elements. This is due to caching i assume, I just want to know if there is a way around this road block?

::In the video::
Look for the flicker in the elements background upon each request being sent and the called back. Also note that if I open up to the image directly in a different browser window it truly is updating, but the elements in the application is not the same story.

Also note the reason I know its cache issue is cause upon refreshing the second window of the image directly, and then going back to adjust the crop box the element updates... but only once..


11-12-2009, 04:04 AM
god I love ajax!
Random numbers appended to the ends of the image / requests names cleared up the cache issue.. flicker is a bit longer but for the sakes of the application it will do!