HTML Automatic Image Refresh

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I'm having a tough time getting the answer for this. My HTML is lent
out. I don't need my HTML book for a year; I lend it out, and four
days later, whaddayaknow, I need it again. So I'm relegated to the
web, and Google isn't even helping out.

Anyway, what I'm trying to do is reload an image not from the cache
but from the server every time the page is reloaded. The reason is the
image may have changed; it's not a simple, constant image file. I know
the server will grab it from the server when you refresh (F5, the
refresh button, etc.), but I mean every time.

I've tried <META NAME = "EXPIRES" CONTENT = "0">, and this doesn't
seem to do the job. Maybe it only works on HTML content, not images.
I'm new to meta tags, but as I understand, this will tell the browser
to use content from the server rather than the cache (as in the page
expires immediately). It's not working.

Is there a way of doing what I need with all browsers? Seems unlikely,
but stranger things have happened.

Am I explaining this properly? Not so sure, but I hope this helps to
explain what I need. Every link I get from Google, I end up seeing
content about how to make the page automatically refresh after x
seconds, which is not what I want. This is probably partly because I
don't exactly what search words to use....

Re: HTML Automatic Image Refresh

Liam Gibbs wrote:
Quoted text here. Click to load it

<META> tags only apply to the HTML content, and even then they're not
100% reliable. To achieve what you want, you must configure your server
to send image files with particular HTTP headers that specify the cache
time. e.g. with Apache, you can specify:

    ExpiresActive On
    ExpiresByType image/gif A0

in your .htaccess or httpd.conf, and there are various other directives
that are needed as well (someone else will probably be able to give you
more info, I haven't played around with Apache settings much).

If the image is dynamically generated by PHP, you can specify:


at the start of the PHP script.


Site Timeline