Note: This question is not a duplicate of similar questions where the answer calls for a javascript/php generated random number query tacked onto the end of the image names. As I explained in the original post, I can't use javascript in the code. The users are doing a one-time copy of the HTML and pasting it into locations that cannot run javascript
I run a web service that generates image files for users that show their progress on certain geocaching goals (geocaching is just an outdoor hobby.) The images sit on my server. Then, the service gives the user HTML code to reference the images and they can copy/paste that HTML into other websites such as their personal blogs or their personal profile on the main geocaching website.
The idea is that they can periodically come to my site and generate NEW updated images. The images still have the same name on the server. That way the HTML they previously copy/pasted still works...it references the same images, but those images have been updated.
However... caching is a problem. Often, I'll generate the new images, but the user will still see old images on their personal blog or wherever because the old images were cached.
- I can give the users HTML code that tacks a random query parameter on the image src, but that won't help because they are only copying/pasting that HTML one time. The random query parameter will only be generated once, and after the first load, the images will be cached and there wont be a new random query parameter.
- I can't give the users HTML code that contains javascript to generate the random query parameter every time the HTML is read because they are copying this HTML code into fields that usually can't run scripts.
- I can't try to disable caching on their end obviously since they are pasting this HTML into other sites.
Is there anything I can do to disable the caching for these images from the plain HTML? Any img attribute I can use? Any ideas for solving this tricky problem?