Caching isn't the only reason the image may be cached not be loaded, the browser might have images disabled, or not support them in the first place.
A meta tag isn't going to do you any good, nor is changing the HTML document - it is the image being cached, not the HTML.
You need to send real HTTP headers along with the image, and you can do that from CGI. The standard text on the subject is the mnot Caching Tutorial.
As for images already cached by the browser - you'll just have to wait until their cache expires and they request it again (and get the new cache control headers). That, or hack around it by changing the URL of the image in the HTML source (adding/changing a query string is a simple way to do that).
| [reply] |
I think that Apache (I assume you're using Apache; in this kind
of context if your web server is anything else you should say so) by
default will send Pragma: no-cache along with the output of a CGI script,
but if someone has changed the value of CacheNegotiatedDocs in the
configuration, this may not be happening. In that case, you could
work around it by printing out that header yourself.
If you aren't sure whether the pragma header is being sent, you could
use WWW::Mechanize to find out.
If the pragma is being sent and the web browser is ignoring it,
I'm not sure what to suggest other than adding a random element
to the query string to make the url unique each time, but that
would require that the HTML document be generated each time,
so it won't help you if the image is designed to be used from
static HTML documents (e.g., if it's a counter).
Sanity? Oh, yeah, I've got all kinds of sanity. In fact, I've developed whole new kinds of sanity. Why, I've got so much sanity it's driving me crazy.
| [reply] |
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
Hope it works | [reply] [d/l] |
The OP is generating an image, which doesn't have an HTML head section.
| [reply] |