Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > HTML Automatic Image Refresh

Reply
Thread Tools

HTML Automatic Image Refresh

 
 
Liam Gibbs
Guest
Posts: n/a
 
      04-09-2005
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....
 
Reply With Quote
 
 
 
 
Oli Filth
Guest
Posts: n/a
 
      04-09-2005
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatic Refresh of page (using a timer and .reload) causes messagebox. UJ ASP .Net 2 08-12-2005 03:40 PM
HTTP Automatic Refresh Fabiano ASP .Net 2 06-20-2005 09:40 PM
Automatic refresh when users selects "Back" button in Internet Explorer Leszek Taratuta ASP .Net 2 08-12-2004 03:01 PM
Automatic build process + automatic NuNit (2 in 1 solution) ASP .Net 1 06-29-2004 04:15 PM
Problem with refresh button breaking automatic refresh brian lanning ASP .Net 0 07-29-2003 07:57 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57