Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 67465 invoked from network); 1 Aug 2009 12:54:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Aug 2009 12:54:33 -0000 Received: (qmail 79677 invoked by uid 500); 1 Aug 2009 12:54:37 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 79588 invoked by uid 500); 1 Aug 2009 12:54:36 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 79578 invoked by uid 99); 1 Aug 2009 12:54:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Aug 2009 12:54:36 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Aug 2009 12:54:34 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id CB9AE234C004 for ; Sat, 1 Aug 2009 05:54:14 -0700 (PDT) Message-ID: <1803157452.1249131254829.JavaMail.jira@brutus> Date: Sat, 1 Aug 2009 05:54:14 -0700 (PDT) From: "Mark Hammond (JIRA)" To: dev@couchdb.apache.org Subject: [jira] Commented: (COUCHDB-257) HTTP caching headers don't provide expected behaviour In-Reply-To: <179493481.1234792740572.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/COUCHDB-257?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12737879#action_12737879 ] Mark Hammond commented on COUCHDB-257: -------------------------------------- My last comment probably wasn't very clear (seeing I had to read it a few times myself!) Would adding a 'cache-control: max-age=0' solve the problem with IE? If so, I'd suggest adding such a header to all responses would be reasonable. > HTTP caching headers don't provide expected behaviour > ----------------------------------------------------- > > Key: COUCHDB-257 > URL: https://issues.apache.org/jira/browse/COUCHDB-257 > Project: CouchDB > Issue Type: Bug > Components: HTTP Interface > Affects Versions: 0.8.1, 0.9 > Environment: Server: Ubuntu Hardy on x86. Client: Windows XP (32-bit). > Reporter: Vinay Sajip > Priority: Minor > Attachments: caching-header-patch.diff > > > 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. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.