Erzang gzipped data compression

I have an Erlang application that makes a large number of http client calls using inets. I would like to reduce the bandwidth bill by accepting gzipped data from the servers that provide it. Is there an inets option to handle this? [can't find one]. Is there a mail library that anyone can recommend? [I looked at the zdlib zip library, but it seems to unpack the archives, rather than unpack the individual streams].

Thank!

+5
source share
2 answers

Take a look zlib. See also the option file:open/2 compressedfor possible future use. Note that zipand zlibaka gzipnot the same. I think you already noticed that.

Take a look at http://blog.gebhardtcomputing.com/2007/09/grab-webpage-in-erlang-which-is-gzipped.html for some inspiration, but you will probably need streaming that is well described on the manual page.

+2
source

I would suggest performing compression / decompression in the HTTP interface (nginx, apache, etc.). This will be more optimal.

0
source

All Articles