Disable image caching?

Discussion in 'HTML' started by Noozer, Jun 2, 2005.

  1. Noozer

    Noozer Guest

    I load a webpage on my client PC, change an image file on the server, and
    reload the webpage on the client. I still see the orignal image.

    Currently I have the following at the top of my page source:
    <%
    response.ContentType = "image/jpeg"
    Response.CacheControl = "no-cache, must-revalidate"
    Response.AddHeader "Pragma", "no-cache"
    Response.Expires = -1
    Response.AddHeader "Last-Modified", date
    %>

    IIS is set to expire content immediately.

    What do I need to do to ensure that the images are fresh from the server
    every time? (...and I did search Google and no solutions I could find made
    any difference.)

    Thx!
     
    Noozer, Jun 2, 2005
    #1
    1. Advertising

  2. Noozer

    Toby Inkster Guest

    Noozer wrote:

    > Currently I have the following at the top of my page source:
    > <%
    > response.ContentType = "image/jpeg"
    > Response.CacheControl = "no-cache, must-revalidate"
    > Response.AddHeader "Pragma", "no-cache"
    > Response.Expires = -1
    > Response.AddHeader "Last-Modified", date
    > %>


    At the top of the *page* or the top of the *image*. You need to send these
    headers with the *image*. (Alternatively, just change the image file name
    every time you update it.)

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
     
    Toby Inkster, Jun 2, 2005
    #2
    1. Advertising

  3. Noozer

    Noozer Guest

    "Toby Inkster" <> wrote in message
    news:p...
    > Noozer wrote:
    >
    > > Currently I have the following at the top of my page source:
    > > <%
    > > response.ContentType = "image/jpeg"
    > > Response.CacheControl = "no-cache, must-revalidate"
    > > Response.AddHeader "Pragma", "no-cache"
    > > Response.Expires = -1
    > > Response.AddHeader "Last-Modified", date
    > > %>

    >
    > At the top of the *page* or the top of the *image*. You need to send these
    > headers with the *image*. (Alternatively, just change the image file name
    > every time you update it.)


    Doh!

    Thanks... Moving it to the image seems to have it working as needed. I
    assumed that at the top of the page I was telling it not to cache any
    images.
     
    Noozer, Jun 5, 2005
    #3
    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,638
    Eliyahu Goldin
    May 13, 2004
  2. Mike Sobeiski
    Replies:
    2
    Views:
    5,835
    Lenard Gunda
    Aug 7, 2004
  3. Dominic
    Replies:
    3
    Views:
    16,778
    Whitecrest
    Jun 30, 2004
  4. JimLad
    Replies:
    3
    Views:
    948
    JimLad
    Jan 21, 2010
  5. Kamyar Souri

    Disable Image Caching

    Kamyar Souri, May 13, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    181
    Vidar Petursson
    May 14, 2004
Loading...

Share This Page