Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 4850 invoked from network); 17 Mar 2010 20:54:39 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 17 Mar 2010 20:54:39 -0000 Received: (qmail 57302 invoked by uid 500); 17 Mar 2010 20:54:38 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 57127 invoked by uid 500); 17 Mar 2010 20:54:38 -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 57119 invoked by uid 99); 17 Mar 2010 20:54:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Mar 2010 20:54:38 +0000 X-ASF-Spam-Status: No, hits=-3.3 required=10.0 tests=AWL,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [93.93.131.91] (HELO aristaeus.mediagraft.com) (93.93.131.91) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Mar 2010 20:54:33 +0000 Received: from merrells by aristaeus.mediagraft.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1Ns0Fn-0004CA-N0 for user@couchdb.apache.org; Wed, 17 Mar 2010 20:54:12 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1077) Subject: Re: standalone attachments and content-encoding header From: John Merrells In-Reply-To: <20100317204512.GA15930@uk.tiscali.com> Date: Wed, 17 Mar 2010 13:53:57 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <70763547-33D8-475C-90FC-296E3D46B4E3@merrells.com> <20100317202433.GB15544@uk.tiscali.com> <1D4FF5BA-E337-4BA5-874D-E5DD72D61811@merrells.com> <20100317204512.GA15930@uk.tiscali.com> To: user@couchdb.apache.org X-Mailer: Apple Mail (2.1077) On Mar 17, 2010, at 1:45 PM, Brian Candler wrote: > On Wed, Mar 17, 2010 at 01:32:24PM -0700, John Merrells wrote: >> I'll give it a go... >=20 > Can you add -v to that too? * About to connect() to 69.164.201.44 port 5984 (#0) * Trying 69.164.201.44... connected * Connected to 69.164.201.44 (69.164.201.44) port 5984 (#0) * Server auth using Basic with user 'admin' > GET /pages/http%3A%2F%2Fjohnmerrells.com/page HTTP/1.1 > Authorization: Basic YWRtaW46Y2FtbWF4em9l > User-Agent: curl/7.19.6 (i386-apple-darwin10.0.0) libcurl/7.19.6 = zlib/1.2.3 > Host: 69.164.201.44:5984 > Accept: */* > Accept-Encoding: deflate, gzip >=20 < HTTP/1.1 200 OK HTTP/1.1 200 OK < Server: CouchDB/0.10.1 (Erlang OTP/R13B) Server: CouchDB/0.10.1 (Erlang OTP/R13B) < ETag: "2-1d1c512ddcf00a7d8b1a7f8052f06314" ETag: "2-1d1c512ddcf00a7d8b1a7f8052f06314" < Date: Wed, 17 Mar 2010 20:46:51 GMT Date: Wed, 17 Mar 2010 20:46:51 GMT < Content-Type: text/html; charset=3DUTF-8 Content-Type: text/html; charset=3DUTF-8 < Content-Length: 19909 Content-Length: 19909 < Cache-Control: must-revalidate Cache-Control: must-revalidate >=20 >> I'm not asking couch to compress the content before sending it, as I = compressed >> it before I pushed it up. All I want is for couch to send me back = that content-encoded=20 >> header that I sent up with it.... >=20 > I don't think it's that simple. For docs, couchdb has to parse the = JSON you > send it (to turn it it into erlang terms), so it has to uncompress it > anyway. It's not json :-) >=20 > As for attachments, I'm not sure but I *believe* they're always stored > compressed. I remember seeing some optimisation work in progress, so = that > if the client sends a compressed attachment it would be saved as-is = rather > than decompressed and recompressed - or something like that. =46rom what Futon reports it doesn't appear that way. But I want to also be sending compressed data, not having couch do the=20= compressing. >=20 >> then the user agent will do the right thing when it >> resolve the attachment url into couch.... right now the browser gets = text/html and >> a bunch of binary... if it had content-encoded then it'd know to = decompress it before >> displaying it.... >=20 > Ah, then I've missed the point. Are you saying that you're storing an > attachment with Encoding: gzip, and couchdb is returning the gzipped = binary > blob but without an Encoding: gzip header? Perhaps there's a bug. = What > version of couchdb? Have you got a simple test case to reproduce it? Bingo. 10.1 Some pseudo ruby=20 attachement=3D Zlib::Deflate.deflate("some html text") headers=3D = {'content-encoding'=3D>'deflate',:content_type=3D>'text/html'} @db.put_attachment({'_id'=3D>'foo'},'page',attachement,headers) Now point your browser at the url for that attachment and a blob is = displayed rather than decompressed and displayed. John --=20 John Merrells http://johnmerrells.com +1.415.244.5808