How to prevent caching a .GIF image in browser?
Posted on 2002-07-25
I am dynamically generating a GIF image, but have run into a problem. Because it is always generated under the same filename, my browser's cache gets in the way -- it works great the first time, but each additional time the cached GIF is displayed, not the newly generated GIF. If I clear the browser cache, it works fine again, but obviously only once.
Is there something I can specify on the image tag to prevent the browser (Netscape, in this case) from caching a GIF? The only option I can think of is to dynamically write to a different filename each time, but that complicates things, so I would like to avoid it.
BTW, before you start pointing out problems with this design (like it is CPU intensive, or simultaneous users would clobber each other's images on the server), let me say that this is strictly an admin function, run by a single individual -- I really do have valid reasons to do it this way.
Thanks in advance,