My JavaScript application requires frequent refreshing of thumbnails. I have implemented a timer that changes the src
attribute of a thumbnail from someImage.jpg
to someImage.jpg?0
, then someImage.jpg?1
, and so on. This method successfully triggers a reload of the image on most desktop browsers, but Safari on iOS (iPad and iPhone) seems to have a stubborn caching policy that prevents this.
Safari ignores the querystring and does not request the new asset, causing an issue in updating the images. Is there a way to force all browsers, including Safari, to reload an image?
Any solution that involves changing the URL of the image server-side would not be feasible for me, so I am seeking a JavaScript-based approach to solve this problem.