Uploaded image for project: 'CouchDB'
  1. CouchDB
  2. COUCHDB-257

HTTP caching headers make Internet Explorer experience poor

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Won't Fix
    • 0.8.1, 0.9
    • None
    • HTTP Interface
    • Server: Ubuntu Hardy on x86. Client: Windows XP (32-bit).

    Description

      The HTTP caching headers currently put out cause IE (for example) to not display information correctly in Futon. It's easy to reproduce: I open windows in Firefox and IE simultaneously, do an update using Firefox (e.g. add a new document) and refresh the IE window. The updated document count is not shown. If I clear the browser cache and try again, the updated information is displayed. The HTTP header put out is

      Cache-Control: must-revalidate

      which seems to me insufficient - for IE, at least. Is there way of configuring these headers, to for example

      Cache-Control: no-cache
      Pragma: no-cache
      Expires: some date in the past, or the same value as the Date: header

      Christopher Lenz has said about this that "This is due to extra-aggressive (and against the HTTP spec) caching that IE does on XMLHTTPRequests. A patch would need to do user agent sniffing to conditionally add the "cache: false" parameter to the jQuery ajax() invocations in jquery.couch.js (and maybe elsewhere). I wouldn't want to add this for all user agents, as it basically circumvents any caching for AJAX requests (even for not-craptastically-broken implementations), and thus would add quite a bit of unnecessary overhead."

      To this, I would comment that I don't believe a patch to the client-side code in Futon would be sufficient. There are other clients out there, some of which will be on Windows and so by default use the (acknowledgely broken) Microsoft stack. In my view it is more important to err on the side of correctness than performance - so I believe the headers generated server-side need to change, as well as perhaps Futon client-side changes.

      I note that handle_uuids_req in couch_httpd_misc_handlers.erl uses the no-cache/Expires scheme I mention.

      Attachments

        1. expires.patch
          1 kB
          Curt Arnold
        2. caching-header-patch.diff
          2 kB
          Vinay Sajip

        Issue Links

          Activity

            People

              Unassigned Unassigned
              vsajip Vinay Sajip
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: