SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot
    Join Date
    Aug 2001
    Location
    DC
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    cache and back button question

    Does anyone know exactly how Netscape and IE deal with cache when a user pushes the back button.

    Say a user views page A and then moves on to page B but then pushes the back button to again view page A. When they view page A a second time, does the browser send out a request to the server for page A, is it just displayed from cache, or both?
    signature

  2. #2
    SitePoint Guru bronze trophy blufive's Avatar
    Join Date
    Mar 2002
    Location
    Manchester, UK
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That depends on several things. The server might have sent headers that prevented the browser storing the page in the cache at all, or which cause the page to expire from the cache after a short period. The browser may be configured to check with the server every time, regardless.

    There are other factors too - the browser may do different things depending on whether the page was the result of an HTTP POST or GET, for instance.

    In short: it can be complicated.

  3. #3
    SitePoint Zealot
    Join Date
    Aug 2001
    Location
    DC
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK, how about any specific links to pages that discuss how the browsers interact? I'm trying to shore up my knowledge of how browsers cache pages under different circumstances. Is there any good resource here on the subject? If so, can you be specific about a web page or article (not a site).

    I believe understanding these interactions are really crucial to building solid web apps however I find it very difficult to get good info on it.
    signature

  4. #4
    SitePoint Guru bronze trophy blufive's Avatar
    Join Date
    Mar 2002
    Location
    Manchester, UK
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    First off, you need to get some idea about cache-control headers. While this isn't the most readable reference, is IS the most important: the relevant section of the HTTP 1.1 spec

    A more generall tutorial: http://www.mnot.net/cache_docs/

    If a page was generated by a form submission (either a HTTP POST or a HTTP GET with a query string) then browsers are usually smart enough to not cache it. So that's not an issue.

    From the perspective of a web app, you probably want to exert some control over caching, for various reasons. From a usability perspective, however, it's rarely a good idea to disable caching completely - this will destroy the functionality of the back button, which is a big no-no.

  5. #5
    SitePoint Zealot
    Join Date
    Aug 2001
    Location
    DC
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for the info
    signature

  6. #6
    SitePoint Zealot
    Join Date
    Aug 2001
    Location
    DC
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have been reading the HTTP definitive guide by O'Reilly & Associates and it's very good. It does discuss browsers but it really gives a firm grounding on overall HTTP which includes caching mechanisms.
    signature


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •