-
-
Notifications
You must be signed in to change notification settings - Fork 8k
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
[New] Enable curl auto compression/decompression #1437
Conversation
cda970f
to
38e564a
Compare
Upping the required version of curl would be a breaking change. What happens in an older version of curl that doesn't understand the flag, if the flag is passed? Is there a reliable way to detect if curl supports the flag, and only pass it when it does? |
If the user can't get a curl version newer than 2002 Sep released, I wonder how old the system is and may also failed on other dependencies like git v1.7.0, if we really need to test its ability of parameters, I doubt if we should just test every parameters we are using rather than just this one? Anyway, I guess we can test this feature by |
That's a fair point; and if you can find evidence that git v1.7.0 only works on a system with a |
Sorry I didn't understand what do you mean evidence that git v1.7.0 only works on a system with a curl that supports --compressed, can you explain more details? Thanks. |
I mean, find out the system requirements for |
I'm not sure what exactly I should to do confirm that, test all famous unix distros? A little bit too hard and too harsh IMO. As we choose Ubuntu 12.04 as the signal of git version requirement, and |
Tested on CentOS 5 which has no git package by default, works very well. |
Tested with Fedora 20, also works well, I think a 15 years feature could be very widely deployed, what do you think? |
My concern is that git is not actually required to use nvm - only curl or wget is. Altering the git requirement just means people can't get a nice git clone of NVM_DIR - altering the curl requirement could mean people can't use nvm whatsoever. That requires a harsh criteria, I think. |
Thanks for reply @ljharb, if both old CentOS and Ubuntu supports it, I also test it on and it can be traced back to 2002, isn't this good enough? BTW, I just test on another old system - Debian 6, works perfectly. It's very not easy to test those out of maintenance systems, they don't even have a valid package repository anymore. |
It'd also need to be tested on old Mac OS X versions. |
That'll be a problem for me, I have no environment for that, any suggestions or would you like to help on this part? Thanks. |
Hmm. I think I'm convinced that the age of the curl version won't be a problem. However, my googling indicates that |
@ljharb AFAIK the help message is "static", so No, we can't detect from that, just like http/2.0 feature in curl, but I wonder if we should even test all features that can be optional in the compilation? At least I didn't find a real case that a common package repository that provides curl without that feature, just like all the browsers support gzip compression. |
@PeterDaveHello ok, let's do it - but let's add a note to the readme noting the new requirement for |
@ljharb I need your review and maybe even reword, thanks
|
|
38e564a
to
da52e81
Compare
Update, thanks! |
cb77efa
to
7613c6e
Compare
7613c6e
to
4697365
Compare
Seems like there's some test failures. |
4697365
to
4cdbfc6
Compare
Not sure if all fixed now, let's see. |
Still a failure - looks like you forgot to unload |
4cdbfc6
to
f5da5c0
Compare
@ljharb seems so, I must messed up some of the progress so I lost this part, added it back :) |
not sure what's the relationship with |
Enable `--compressed` parameter on curl to automatically enable compression on request content by sending coressponding header, if the server side supports compression format like deflate or gzip, curl will also decompress the content automatically, so there is no additional works need to done manually on client side, but just enjoy the benifits of bandwidth and time saving! Take https://nodejs.org/dist/index.tab as an example which is last modified on Tue, 14 Mar 2017 22:41:05 GMT, the compressed transmission only take 4829 bytes howevet the not compressed on taks 48000 bytes, which is about 10 times larger! This feature can be traced back to Sep 3 2002, in curl commit: - curl/curl@64bbe9d So should be supported on various versions widely.
f5da5c0
to
973dfc6
Compare
Fixed now. |
Enable
--compressed
parameter on curl to automatically enablecompression on request content by sending coressponding header, if the
server side supports compression format like deflate or gzip, curl will
also decompress the content automatically, so there is no additional
works need to done manually on client side, but just enjoy the benifits
of bandwidth and time saving!
Take https://nodejs.org/dist/index.tab as an example which is last
modified on Tue, 14 Mar 2017 22:41:05 GMT, the compressed transmission
only take 4829 bytes howevet the not compressed on taks 48000 bytes,
which is about 10 times larger!
This feature can be traced back to Sep 3 2002, in curl commit:
So should be supported on various versions widely.
(even on Ubuntu 08.04, just tested!)