Changing the compression level in GZipMiddleware#730
Closed
bronekot wants to merge 2 commits intoKludex:masterfrom
bronekot:master
Closed
Changing the compression level in GZipMiddleware#730bronekot wants to merge 2 commits intoKludex:masterfrom bronekot:master
bronekot wants to merge 2 commits intoKludex:masterfrom
bronekot:master
Conversation
…n gzip.GzipFile compresslevel is 9. This commit saves the behavior of the standard library, but allows you to override compresslevel. High values are not recommended for streaming compression.
Contributor
lovelydinosaur
left a comment
There was a problem hiding this comment.
Thanks! I’m totally in favour of us switching the compression level in GZipFile, yup!
But... let’s not bother making it configurable. Having fewer things for the end user to think about is a good thing! 😃
|
I currently don't include this middleware because of performance. Making this an optional parameter to allow tuning would be amazing! (But at least bringing it down from 9 to a more reasonable level such as 2 would be good.) |
|
What's the status on this pull request? Sounds great to me as I am also experiencing performance issues |
Owner
|
I just saw this PR, the same idea was merged on #1128, and it's available on Starlette 0.15.0. @bronekot Thanks for the PR! 😄 And... Sorry for the long wait. 😰 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Being one of your users I find the speed of stream compression too slow at times. I strongly believe that adding this feature will benefit a lot of users. It will not interfere with the functionality if not used but will give the users control over the compression level. Sorry for sending this again. This time I made sure it is formatted properly.