Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8ACC1C0ED for ; Tue, 1 May 2012 16:43:07 +0000 (UTC) Received: (qmail 2308 invoked by uid 500); 1 May 2012 16:43:05 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 2275 invoked by uid 500); 1 May 2012 16:43:05 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 2267 invoked by uid 99); 1 May 2012 16:43:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 May 2012 16:43:05 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jens@couchbase.com designates 206.225.164.28 as permitted sender) Received: from [206.225.164.28] (HELO EXHUB020-1.exch020.serverdata.net) (206.225.164.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 May 2012 16:43:00 +0000 Received: from EXVMBX020-1.exch020.serverdata.net ([169.254.4.3]) by EXHUB020-1.exch020.serverdata.net ([206.225.164.28]) with mapi; Tue, 1 May 2012 09:42:38 -0700 From: Jens Alfke To: "user@couchdb.apache.org" Date: Tue, 1 May 2012 09:42:37 -0700 Subject: Continuous-mode _changes feed without chunked encoding? Thread-Topic: Continuous-mode _changes feed without chunked encoding? Thread-Index: Ac0nuWrCtMnzXiwcTU+ji4Q0Jx4pyg== Message-ID: <8F871DD2-C8D8-4723-93AB-EB2114C76A84@couchbase.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org Is it possible to receive a continuous-mode _changes feed from CouchDB *wit= hout* the response using HTTP chunked encoding? I ask because the use of chunked encoding with a never-closed connection is= causing several problems[1]: (1) It doesn=92t work with some cell carriers=92 (e.g. O2=92s) wireless net= works; no data ever arrives and the request times out. Anecdotally this is = because they use HTTP proxies that don=92t handle chunked mode very well. (2) The HTTP framework in iOS and Mac OS X (NSURLConnection) has a similar = problem; I=92ve filed a bug report on this, but I suspect it=92s trying to = obey the letter of the law[2] and wait for the possible extra HTTP header f= ields in the response trailer before sending any response to the client. Obviously it is possible to work around this by using the long-poll mode in= stead. The disadvantages are * difficult to parse the changes incrementally before the entire response h= as arrived, because that would require a streaming (SAX-mode) JSON parser. = This is a performance problem during replication. * requires more HTTP connections to be made, so has greater latency. Technically it=92s not kosher to send an indefinitely-long never-closed res= ponse without chunked mode. But it=92s been done for a long time for servic= es like MP3 streaming (ShoutCast). Generally they just include a fictitious= huge content-length like 999999999999. =97Jens [1] https://github.com/couchbaselabs/TouchDB-iOS/issues/72 [2] http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.6.1=