Allow setting compression levels #2928
Labels
A-http
project: actix-http
A-web
project: actix-web
C-improvement
Category: an improvement to existing functionality
Expected Behavior
Although the default compression levels are sane, some users might want to adjust it to better fit their needs. Being able to set the compression levels gives users more control and flexibility.
Current Behavior
That's super easy to add, but there are no ways to fine-tune the compression algos.
Possible Solution
I like the defaults, although the available compression algos aren't that transparent, in a sense that it's tricky to figure out which ones are going to be supported from looking at the init code alone. I think that keeping it that way is fine, but it would be nice to have an alternative way to configure compression, here is a pseudo-code:
I'm relatively new to Rust, so take it with a grain of salt, I'm sure there are some more convenient/idiomatic patterns which can be used to setup the compression levels.
Context
I'm fine with the current defaults but I have some spare CPU capacity so it wouldn't hurt to keep it busy. Also, I'm planning to add Tor support to one of the APIs I'm working on, so optimizing for bandwidth would certainly help to speed things up a bit.
The text was updated successfully, but these errors were encountered: