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
    Jawahar Rajan, Sep 23, 2003
    #1
    1. Advertising

  2. > I want to keep the session at 20 minutes hence the 20
    > minute page expiration.


    I think you meant to set session.timeout (see http://www.aspfaq.com/2066).
    Response.Expires has nothing at all to do with a session.

    > but I Do not want to cache the page on the server.


    See http://www.aspfaq.com/2022
    Aaron Bertrand - MVP, Sep 23, 2003
    #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. Jeff Nokes

    Cache::Cache Stale Segments

    Jeff Nokes, Sep 30, 2003, in forum: Perl
    Replies:
    0
    Views:
    552
    Jeff Nokes
    Sep 30, 2003
  2. DesignerX

    Page.Cache vs HttpContext.Current.Cache

    DesignerX, Jan 20, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    8,219
    vMike
    Jan 20, 2004
  3. =?Utf-8?B?b25l?=
    Replies:
    1
    Views:
    5,261
    Karl Seguin [MVP]
    Mar 8, 2006
  4. Sergey via DotNetMonster.com

    ASP.NET Cache vs Window System Cache

    Sergey via DotNetMonster.com, Nov 15, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    460
    Sergey via DotNetMonster.com
    Nov 15, 2006
  5. John
    Replies:
    2
    Views:
    1,167
Loading...

Share This Page