5

It seems that couchdb automatically compress all its _attachments when requested with the correct header. But unfortunately this doesn't happen for views, show or lists.

Is there any way to achieve a compression before returning the result to the client?

Is using a third party library like deflatejs (didn't test it yet) a bad approach?

Thanks

zanona
  • 12,345
  • 25
  • 86
  • 141

2 Answers2

3

You can certainly use js-deflate in show and list functions, but you cannot do it in view functions. I also suspect it would be inefficient (just a guess, test it if you want numbers).

Until CouchDB does not support gzip encoding, the easiest solution is to put a reverse proxy in front of CouchDB to do the compression. For example you can use nginx with the HttpGzipModule.

Marcello Nuccio
  • 3,901
  • 2
  • 28
  • 28
1

The Couchbase distribution of CouchDB (Couchbase Single Server) supports Google's snappy compression for the JSON files on disk. I believe the same goes for the views, but I'll have to defer to someone better qualified.

Perry Krug
  • 665
  • 4
  • 6
  • As explained [on their blog](http://blog.couchbase.com/driving-performance-improvements-couchbase-single-server-20), the compression is for the contents written on disk, not for communication with the client. – Marcello Nuccio Oct 04 '11 at 11:54