Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--compressed is non-optimal #22

Open
bagder opened this issue Oct 17, 2019 · 0 comments
Open

--compressed is non-optimal #22

bagder opened this issue Oct 17, 2019 · 0 comments

Comments

@bagder
Copy link

bagder commented Oct 17, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant