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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃搨 Add option for gzip_compression_level
for Rack::Deflater
.
#1734
Conversation
`:gzip_compression_level ::` An integer from 0 to 9 controlling the level of compression; 1 is fastest and produces the least compression, and 9 is slowest and produces the most compression. 0 is no compression. The default is 6. This is only needed for the `gzip` type encoding.
gzip_compression_level
.gzip_compression_level
for Rack::Deflater
.
2bc699e
to
572fe62
Compare
This looks good to me. Do you think |
This also looks good to me. Currently, only gzip encoding is supported, but I could see |
I think if the compression algorithm could be different, which is possible and likely in the future, we should not embed the name of the compression algorithm in the option. |
@ioquatix what were you thinking? EDIT: EDIT EDIT: |
Just want to point out that brotli has a |
I took a look at how this is implemented in other places. In It would be nice to set options in a generic way. I checked node.js and they expose gzip, deflate, brotli all through the same interface, but there is a way to set options. https://nodejs.org/api/zlib.html#zlib_brotli_constants My suggestion would be something like:
This is just pseudo code. This means we are not interpreting the value of the options which means we don't worry about naming or anything else. |
I love the idea. I'm unsure how to implement that idea. Since |
@ioquatix @nateberkopec any update on this? Happy to change the code. I'm mostly looking for the functionality to exist more than how I want the code to be structured. Let me know. [: |
This would be useful on a system with smaller memory to be set to a lower number, and a system with higher compression needs to compress up to level 9.
:gzip_compression_level ::
An integer from 0 to 9 controlling thelevel of compression; 1 is fastest and produces the least compression,
and 9 is slowest and produces the most compression. 0 is no compression.
The default is 6. This is only needed for the
gzip
type encoding.