Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compressing (Gzip or Deflate) Shows, Lists and views in Couchdb

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

like image 323
zanona Avatar asked Oct 09 '22 22:10

zanona


1 Answers

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.

like image 83
Marcello Nuccio Avatar answered Oct 14 '22 02:10

Marcello Nuccio