Skip to content

--compressed is non-optimal #22

@bagder

Description

@bagder

curl --compressed now generates this code:

curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

While curl --compressed localhost --libcurl - will show that a better code version would be:

curl_setopt($ch, CURLOPT_ENCODING, '');

IOW: an empty string. According to the docs:

To aid applications not having to bother about what specific algorithms this particular libcurl build supports, libcurl allows a zero-length string to be set ("") to ask for an Accept-Encoding: header to be used that contains all built-in supported encodings.

With an empty string, we can be sure that curl will ask for compression methods it knows how to decompress, which may include the ones you've picked but may not and may also include brotli and others in the future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions