in reply to Preventing an image from caching

If you are generating the page, append a random number to the call for the image.
<IMG SRC="/cgi-bin/image.pl?rand=4531269823">
Each time the page draws the string will be different, eliminating the cached image problem because to the browser it is not the same image.

Replies are listed 'Best First'.
Re: Re: Preventing an image from caching
by belize (Deacon) on Nov 28, 2000 at 20:23 UTC
    Thanks for the post, but I am generating the image, saving it to a file, then calling the file with the <IMG...> tag. I can't seem to get the image to go directly to the page because all I get is ASCII text instead of hte binary.
      Call the file with this script.
      #!/bin/perl $image = `cat imagenameandpath`; print "Content-type: image/png\n\n"; print $image;
      It's the simplest way i know.

      BTW- image/png is for png file format, substitute gif, jpeg, for others.