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

Allow setting compression level per algorithm #228

Open
palant opened this issue May 6, 2024 · 0 comments
Open

Allow setting compression level per algorithm #228

palant opened this issue May 6, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request WIP We are working on this feature internally

Comments

@palant
Copy link

palant commented May 6, 2024

What is the problem your feature solves, or the need it fulfills?

Compression level can currently be set as following:

session.downstream_compression.adjust_level(9);

This calls ResponseCompressionCtx.adjust_level(). However, with gzip, brotli and zstd there are currently three compression algorithms supported, in future possibly more. The given compression level applies to all of them. And compression level 9 for gzip is radically different from compression level 9 for zstd.

Describe the solution you'd like

This API needs per-algorithm compression levels. So maybe adjust_level_gzip(9) and adjust_level_zstd(18), or some method taking an algorithm identifier along with a compression level. If necessary, method adjust_level() can be kept around for backwards compatibility and will still set the compression level for all algorithms.

Describe alternatives you've considered

It’s possible to set the compression level to 3 or 4 – these levels just so happen to provide a good tradeoff between size and speed for all of the supported algorithms. But that’s merely a coincidence.

@palant palant changed the title It should be possible to set compression level for each algorithm Allow setting compression level per algorithm May 6, 2024
@andrewhavck andrewhavck added the enhancement New feature or request label May 9, 2024
@gumpt gumpt self-assigned this May 10, 2024
@gumpt gumpt added the WIP We are working on this feature internally label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request WIP We are working on this feature internally
Projects
None yet
Development

No branches or pull requests

3 participants