Cache vs no Cache

Discussion in 'ASP General' started by Jawahar Rajan, Sep 23, 2003.

  1. All
    I have the following code in my ASP Pages. These are the
    first lines of Code in most of my pages.

    'Ensure only 20 minute caching
    Response.Expires = 1200
    Response.buffer = True
    Response.CacheControl = "no-cache"
    Response.addHeader "pragma","no-cache"
    Response.addHeader "cache-control","private"

    Have I understood this correctly. The page will expire in
    20 Minutes (20 * 60 = 1200), but the server will not cache
    the page. however within a given 20 minute period user can
    use the back button and they should not get a
    Warning "Page has expired Message"

    I want to keep the session at 20 minutes hence the 20
    minute page expiration. but I Do not want to cache the
    page on the server. Is this the correct approach. Or do
    Ihave to specify a time for the Server Cache as well.

    And Do I need both these lines?
    As one is a page header does this apply to the Client only?

    Response.CacheControl = "no-cache"
    Response.addHeader "pragma","no-cache"

    or can I leave the Cache part out completely as after 20
    minutes the request must be made again.

    Any help or suggestiona are always appreciated.
    Jawahar Rajan, Sep 23, 2003
    1. Advertisements

  2. I want to keep the session at 20 minutes hence the 20
    I think you meant to set session.timeout (see
    Response.Expires has nothing at all to do with a session.
    Aaron Bertrand - MVP, Sep 23, 2003
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.