Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Preventing an image from caching

by bastard (Hermit)
on Nov 28, 2000 at 20:19 UTC ( [id://43689]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://43689]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-16 14:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found