How to force a web browser NOT to cache images
Armin Ronacher has the correct idea. The problem is random strings can collide. I would use:
<img src="picture.jpg?1222259157.415" alt="">
Where "1222259157.415" is the current time on the server.
Generate time by Javascript with performance.now()
or by Python with time.time()
Simple fix: Attach a random query string to the image:
<img src="foo.cgi?random=323527528432525.24234" alt="">
What the HTTP RFC says:
Cache-Control: no-cache
But that doesn't work that well :)