How to disable browser caching for an image?

Discussion in 'HTML' started by Dominic, Jun 29, 2004.

  1. Dominic

    Dominic Guest

    Hi all,

    If I want to disable browser caching for the whole page, I can use the
    following.

    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">

    However, what I really want is to disable browser caching for a
    certain image in the page. Is it possible?

    Thanks
    Dom
     
    Dominic, Jun 29, 2004
    #1
    1. Advertising

  2. Dominic

    Mark Parnell Guest

    On 29 Jun 2004 14:27:49 -0700, Dominic <> declared in
    alt.html,alt.html.tags:

    > Hi all,


    G'day.

    > If I want to disable browser caching for the whole page, I can use the
    > following.
    >
    > <META HTTP-EQUIV="Pragma" CONTENT="no-cache">


    You can use whatever you like. But that doesn't mean the browser will
    not cache it.

    > However, what I really want is to disable browser caching for a
    > certain image in the page. Is it possible?


    No. You can't control caching at all - you can suggest things such as
    the above, but there is no way to guarantee that it won't be cached. And
    there is definitely no way to do it for an individual image.

    --
    Mark Parnell
    http://www.clarkecomputers.com.au
    "Never drink rum&coke whilst reading usenet" - rf 2004
     
    Mark Parnell, Jun 29, 2004
    #2
    1. Advertising

  3. Dominic

    Mitja Guest

    Mark Parnell <>
    (news:1p8nhtpientc3$) wrote:
    > On 29 Jun 2004 14:27:49 -0700, Dominic <> declared
    > in alt.html,alt.html.tags:
    >
    >> Hi all,

    >
    > G'day.
    >
    >> If I want to disable browser caching for the whole page, I can use
    >> the following.
    >>
    >> <META HTTP-EQUIV="Pragma" CONTENT="no-cache">

    >
    > You can use whatever you like. But that doesn't mean the browser will
    > not cache it.


    Very true. It's a suggestion, not an order for the browser. In practice,
    however, it mostly works.


    >> However, what I really want is to disable browser caching for a
    >> certain image in the page. Is it possible?

    >
    > No. You can't control caching at all - you can suggest things such as
    > the above, but there is no way to guarantee that it won't be cached.


    > And there is definitely no way to do it for an individual image.


    It can be done with .htaccess - look it up on the web. Since there are many
    things you can do with an .htaccess, another hint is the <files> tag. You'll
    probably want something like
    <Files graphics/myveryspecialimage.png>
    Header set Expires: 0
    </Files>

    This requires ftp access to the server, apache running and configured in
    such a way that it heeds .htaccess. It may seem like a lot of conditions,
    but fortunately that's often how things are set up.
     
    Mitja, Jun 30, 2004
    #3
  4. Dominic

    Whitecrest Guest

    In article <>,
    says...
    > If I want to disable browser caching for the whole page, I can use the
    > following.
    > <META HTTP-EQUIV="Pragma" CONTENT="no-cache">


    Sometimes...

    > However, what I really want is to disable browser caching for a
    > certain image in the page. Is it possible?


    Do you want it to not cache so it is not on their computer? (won't
    happen) or because you want to make sure they have the most recent
    version of the image every time they go to the page? this can be
    accomplished by changing the name of the image, say with the current
    time.

    Or, use Flash.
    --
    Whitecrest Entertainment
    www.whitecrestent.com
     
    Whitecrest, Jun 30, 2004
    #4
    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. Kamyar Souri

    Disable Image Caching

    Kamyar Souri, May 13, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    2,637
    Eliyahu Goldin
    May 13, 2004
  2. Mike Sobeiski
    Replies:
    2
    Views:
    5,833
    Lenard Gunda
    Aug 7, 2004
  3. Noozer

    Disable image caching?

    Noozer, Jun 2, 2005, in forum: HTML
    Replies:
    2
    Views:
    8,494
    Noozer
    Jun 5, 2005
  4. Replies:
    1
    Views:
    1,723
    Mitja Trampus
    Sep 14, 2005
  5. JimLad
    Replies:
    3
    Views:
    947
    JimLad
    Jan 21, 2010
Loading...

Share This Page