Hello everyone,
I'm the author and maintainer of ibrowse. I know you use ibrowse in CouchDB
and I had an idea a couple of days ago.
Would it help improve performance if ibrowse supported receiving compressed
data from the webserver but made it transparent to the calling process? It
is simple enough for the caller to do (as shown below) it but would it help
if ibrowse supported that natively?
get_url(Url) ->
case ibrowse:send_req(Url, [{"accept-encoding", "gzip"}], get,
[], [{response_format, binary}]) of
{ok, "200", Headers, Body} ->
Headers_lc = [{string:to_lower(X), string:to_lower(Y)} || {X, Y}
<- Headers],
Body_1 = case proplists:get_value("content-encoding", Headers_lc)
of
"gzip" ->
zlib:gunzip(Body);
_ ->
Body
end,
{ok, "200", Headers, Body_1};
Res ->
Res
end.
cheers
Chandru