HTML Automatic Image Refresh

Discussion in 'HTML' started by Liam Gibbs, Apr 9, 2005.

  1. Liam Gibbs

    Liam Gibbs Guest

    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....
    Liam Gibbs, Apr 9, 2005
    #1
    1. Advertising

  2. Liam Gibbs

    Oli Filth Guest

    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
    Oli Filth, Apr 9, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. brian lanning
    Replies:
    0
    Views:
    590
    brian lanning
    Jul 29, 2003
  2. Guest
    Replies:
    1
    Views:
    759
    Guest
    Jun 29, 2004
  3. Leszek Taratuta
    Replies:
    2
    Views:
    14,427
    Leszek Taratuta
    Aug 12, 2004
  4. UJ
    Replies:
    2
    Views:
    6,504
    Lucas Tam
    Aug 12, 2005
  5. raavi

    Automatic Refresh

    raavi, Nov 24, 2005, in forum: Java
    Replies:
    4
    Views:
    5,428
    Viator
    Nov 28, 2005
Loading...

Share This Page