Need Help stopping pages/images from being cached

Discussion in 'ASP General' started by Dan, May 4, 2004.

  1. Dan

    Dan Guest

    Is there an effective way to stop pages from being cached?

    I've created several websites that have dynamic content and images that are
    managed by a client. The images are named according to the "id" generated
    via an Identity column of their corresponding database record (ex:
    1058.jpg). The problem occurs when the client tries to change the image.
    The client gets understandly confused because the old image is still
    displayed, due to the browser caching the image. How can I force the
    browser to stop caching the page/image?

    All of the ASP pages already have the following:

    <%Response.Expires = -1%>
    <meta http-equiv="expires" content="0">
    <meta http-equiv="pragma" content="no-cache">

    Any ideas?

    Thanks,
    Dan


    ---

    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.676 / Virus Database: 438 - Release Date: 5/3/2004
    Dan, May 4, 2004
    #1
    1. Advertising

  2. Dan

    Alan Howard Guest

    I've always turned on Immediate Content Expiration (Web Site Properties ->
    HTTP Headers) and used this in my ASPs:

    Response.AddHeader "expires", "0"
    Response.AddHeader "pragma", "no-cache"
    Response.AddHeader "cache-control", "no-cache"

    Seems to work.

    Alan

    "Dan" <> wrote in message
    news:...
    > Is there an effective way to stop pages from being cached?
    >
    > I've created several websites that have dynamic content and images that

    are
    > managed by a client. The images are named according to the "id" generated
    > via an Identity column of their corresponding database record (ex:
    > 1058.jpg). The problem occurs when the client tries to change the image.
    > The client gets understandly confused because the old image is still
    > displayed, due to the browser caching the image. How can I force the
    > browser to stop caching the page/image?
    >
    > All of the ASP pages already have the following:
    >
    > <%Response.Expires = -1%>
    > <meta http-equiv="expires" content="0">
    > <meta http-equiv="pragma" content="no-cache">
    >
    > Any ideas?
    >
    > Thanks,
    > Dan
    >
    >
    > ---
    >
    > Checked by AVG anti-virus system (http://www.grisoft.com).
    > Version: 6.0.676 / Virus Database: 438 - Release Date: 5/3/2004
    >
    >
    Alan Howard, May 5, 2004
    #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. feng
    Replies:
    3
    Views:
    10,275
    Teemu Keiski
    Feb 8, 2004
  2. Simon
    Replies:
    2
    Views:
    278
    Joerg Jooss
    Jul 17, 2004
  3. Craig G
    Replies:
    0
    Views:
    381
    Craig G
    Mar 7, 2005
  4. Adrian Parker

    Stopping pages from being cached.

    Adrian Parker, Mar 18, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    459
    Adrian Parker
    Mar 18, 2005
  5. Donald Canton

    Delay while images are being cached?

    Donald Canton, Jul 2, 2003, in forum: Javascript
    Replies:
    0
    Views:
    77
    Donald Canton
    Jul 2, 2003
Loading...

Share This Page