cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: On compressed content

From: Nick Zitzmann <nick_at_chronosnet.com>
Date: Wed, 13 Nov 2013 18:14:45 -0600

On Nov 13, 2013, at 11:52 AM, frank ernest <doark_at_mail.com> wrote:

> "--tr-encoding
> (HTTP) Request a compressed Transfer-Encoding response using one
> of the algorithms curl supports, and uncompress the data while receiving it.
>
> --compressed
> (HTTP) Request a compressed response using one of the algorithms
> curl supports, and save the uncompressed document. If this
> option is used and the server sends an unsupported encoding,
> curl will report an error."
>
> What's the difference between the two?

From the curl_easy_setopt man page:

"Transfer-Encoding differs slightly from the Content-Encoding you ask for with CURLOPT_ACCEPT_ENCODING in that a Transfer-Encoding is strictly meant to be for the transfer and thus MUST be decoded before the data arrives in the client. Traditionally, Transfer-Encoding has been much less used and supported by both HTTP clients and HTTP servers.”

> Is curl smart enough to tell when the data, for instance a jpg file,
> is already compressed and so further compression is unnecessary/unwanted?

curl knows nothing of this JPG file you speak of. And the server, not the client, is responsible for compressing the data.

Nick Zitzmann
<http://www.chronosnet.com/>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-11-14