Response compression from View

How can I enable gzip compression for View response?

I was tried add header to HTTP request, for example:

wget -v -d --header="Accept-Encoding:gzip" "http://localhost:8092/price_cache/_design/offers/_view/price_breakdown?connection_timeout=60000&endkey=%5B%22MAD%22%2C1%2C20150211%2C1%5D&inclusive_end=true&reduce=false&stale=ok&startkey=%5B%22MAD%22%2C1%2C20150211%2C0%5D" -O ./price_breakdown.json

But it doesn’t work, I receive json in response

Hi @ateleshev, I don’t believe this is possible. Are you looking at compression to reduce response time? or do you have another reason?

Yes, I am looking ability a fast load big size of response.
For example:
The body size of json response = 5.8 MB, if apply compression to this data we got 238 KB
The time of loading 5.8 MB ~ 2.3 s
The time of loading 238 KB ~ 0.3 s

Could you explain, why it can’t be possible?

This isn’t implemented on our end so we ignore the flag. I did log a new item for us to track this for future. You can subscribe to keep track of the developments on JIRA.
https://issues.couchbase.com/browse/MB-13175
thanks
-cihan

ok, thanks
I will be waiting this functionality.

I hope this functionality will be realized in 3.0.3 version

1 Like

What do you mean with loading? Is it about the network connection between your client and Couchbase?

Yes, It’s about the network connection between my client and view of couchbase via HTTP protocol

Sounds like a pretty slow connection :slight_smile: BTW: one advantage you get from not being gzipped is that the response is streaming, so you can start processing even before you have the full result (This might be possible with GZIP as well, I haven’t really looked into it). And of course you have less latency as you don’t need to compress it.

Yes, it’s slow connect between data centers in different countries