JQueryUI Tabs - Image Caching

I have a form divided into 4 tabs. One of the tabs contains photos if the user has uploaded them. Each photo has a button to delete the photo. It makes an AJAX call to remove the photo and upload in a new input field [file] that the user can use to upload another photo.

This works great. The problem is the user uploads a new photo, it seems like the old photo is still there. If the user refreshes the browser, it doesn't disappear. The user literally has to hold the shift and then update (cache traversal).

The problem is most likely due to the fact that the new image got the name the same as the old one ... and the browser just pulls the cache out of it.

What do I need to do to prevent this from happening? I have already set {cache: false} in jQueryUI tabs. I suppose this is because the image is being cached by the browser. Is there a way to tell the browser not to cache multiple images?

0


a source to share


1 answer


Try adding a parameter to the original file name of the image tag, like the current timestamp, to break the browser cache? Sort of:



<img src="something.jpg?234343234"/>

      

0


a source







All Articles