couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Anderson <>
Subject Re: Content-Encoding: gzip
Date Sat, 31 Jan 2009 06:52:37 GMT
On Fri, Jan 30, 2009 at 10:02 PM, Louis Gerbarg <> wrote:
> I am using CouchDB as backend for some iPhone applications, and one of
> the issues I have is that that the responses are verbose, which is an
> issue over cellular. I decided to take a crack at gzip support, and I
> have something working. A few of you might have seen my post about
> this on the mochiweb list a few days ago, I think I have a solution
> that will be more acceptable for mochiweb, so a significant chunk of
> the code might not really be in CouchDB itself.

I've been following the discussion on Mochiweb's list. Thanks for
digging into this.

> Having said that, I have posted a branch with the first cut on github.
> It works for all GET requests. It also adds buffering to coalesce
> small chunks together even when gzip is not being used. This is my
> first erlang code, so it is definitely not not what I would consider
> production quality.

I think we'd like to have this feature. There are some subtleties for
Couch. One is that for attachments, we may like to receive them
gzipped, store them and send them to clients, all without doing any
reprocessing. This may not be related directly to your patch, but you
should know about it, in case you see places where you could work it

> In particular:
> Some of the code is in the wrong place (like type negotiation)
> It is not properly documented, since I have not read up on Erlang
> documentation style
> It could do better compression with a little more work (fully flushes
> data and resets state when it could avoid that)

Do you feel up to polishing it off or are you hoping to find a
collaborator to get it ready for prime time?

> On the other hand, it appears to generally work and for my usage it
> already is a pretty big win with no changes in our client app ;-) I
> will be cleaning it up a bit, trying to make it acceptable to
> mochiweb, perform better, etc. If anyone is interested you can grab
> the current patchset from
> <>.

Thanks again for digging into details.

Chris Anderson

View raw message