Prevent Browser Caching for a Page

Discussion in 'ASP .Net' started by R. Ian Lee, Oct 22, 2003.

  1. R. Ian Lee

    R. Ian Lee Guest

    I have an ASP.NET page that spawns a popup window using
    javascript's window.open. This works fine. It pops up,
    you enter some data, press save and everything saves as
    it should. But, if you click the button to open the
    popup again, then it opens with the values that were in
    it before the "save" was executed. I've determined that
    the problem is that IE is storing the page in it's local
    temporary internet files cache and isn't going to the
    server to retrieve a fresh version. Is there something
    that I can put in the html header to force IE to always
    expire the page immediately?

    Thanks!

    Ian
    R. Ian Lee, Oct 22, 2003
    #1
    1. Advertising

  2. Hi Ian,

    Based on my research and experience, There are two ways to instruct browser
    not to use the copy in cache.

    1. Add a meta data inside the <head> section. Please check the following
    article for the details.

    Prevent the browser from Caching a page
    http://www.pacificnet.net/~johnr/meta.html
    "...
    This page is an explanation of using the Meta tag to prevent caching, by
    browser or proxy, of an individual page wherein the page in question has
    data that may be of a sensitive nature as in a "form page for submittal"
    and the creator of the page wants to make sure that the page does not get
    submitted twice.
    ..."

    2. From server side, we can render the meta data via the Response object.
    For example,

    Response.Expires = -1

    Please check the HttpResponse class for the detailed info

    Does it answer your question? If I have misunderstood your concern, please
    feel free to let me know.

    Best regards,

    Jacob Yang
    Microsoft Online Partner Support
    Get Secure! ¨C www.microsoft.com/security
    This posting is provided "as is" with no warranties and confers no rights.
    Jacob Yang [MSFT], Oct 22, 2003
    #2
    1. Advertising

  3. Hi Jacob,

    I have a suggestion. For the next version of ASP.Net, include a property of
    the Page class which can turn on or off Browser caching (by adding the
    appropriate headers), and make it non-cached by default. I know of very few
    situations in which ASP.Net pages SHOULD be cached by the browser.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    http://www.takempis.com
    Big Things are made up of
    Lots of Little Things.

    "Jacob Yang [MSFT]" <> wrote in message
    news:...
    > Hi Ian,
    >
    > Based on my research and experience, There are two ways to instruct

    browser
    > not to use the copy in cache.
    >
    > 1. Add a meta data inside the <head> section. Please check the following
    > article for the details.
    >
    > Prevent the browser from Caching a page
    > http://www.pacificnet.net/~johnr/meta.html
    > "...
    > This page is an explanation of using the Meta tag to prevent caching, by
    > browser or proxy, of an individual page wherein the page in question has
    > data that may be of a sensitive nature as in a "form page for submittal"
    > and the creator of the page wants to make sure that the page does not get
    > submitted twice.
    > .."
    >
    > 2. From server side, we can render the meta data via the Response object.
    > For example,
    >
    > Response.Expires = -1
    >
    > Please check the HttpResponse class for the detailed info
    >
    > Does it answer your question? If I have misunderstood your concern, please
    > feel free to let me know.
    >
    > Best regards,
    >
    > Jacob Yang
    > Microsoft Online Partner Support
    > Get Secure! ¨C www.microsoft.com/security
    > This posting is provided "as is" with no warranties and confers no rights.
    >
    Kevin Spencer, Oct 22, 2003
    #3
  4. Hi Kevin,

    Thank you for your suggestion.

    Please feel free to visit the following URL for sending feedback to
    Microsoft Products.

    http://register.microsoft.com/mswish/suggestion.asp?&SD=GN&LN=EN-US&gssnb=1
    "By offering suggestions through this page, you give Microsoft full
    permission to use them freely. We can't guarantee we will use your
    suggestions, but we will review them for use in future products..."

    Best regards,

    Jacob Yang
    Microsoft Online Partner Support
    Get Secure! ¨C www.microsoft.com/security
    This posting is provided "as is" with no warranties and confers no rights.
    Jacob Yang [MSFT], Oct 23, 2003
    #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. gu4y
    Replies:
    2
    Views:
    392
    Shiv Kumar
    Jan 20, 2004
  2. Shardul Kulkarni

    Prevent browser from caching

    Shardul Kulkarni, Mar 16, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    452
    Joerg Jooss
    Mar 19, 2005
  3. Cesare Caldieron

    prevent page caching

    Cesare Caldieron, Aug 23, 2004, in forum: Java
    Replies:
    0
    Views:
    428
    Cesare Caldieron
    Aug 23, 2004
  4. MG
    Replies:
    7
    Views:
    542
    Michael
    Mar 23, 2007
  5. greylin
    Replies:
    0
    Views:
    408
    greylin
    May 16, 2008
Loading...

Share This Page