Liam Gibbs wrote:
> 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.
>
<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:
session_cache_limiter("nocache");
at the start of the PHP script.
--
Oli
|