Recently I had to solve an issue a client was having where an image I had replaced in an app was still showing up in place of the new one. The image was pulled in via Javascript and the iPad browser was stubbornly caching it. I found a neat little trick that works around the caching issue:
If you add a randomized parameter to the image path, the server that holds the image will check for a new one each time. In this case, I used a time stamp.
- Generate a timestamp: var stamp = new Date().getTime();
- Include the timestamp with the img path: "image.png?time=" + stamp;