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

Changing the compression level in GZipMiddleware #730

Closed
wants to merge 2 commits into from
Closed

Changing the compression level in GZipMiddleware #730

wants to merge 2 commits into from

Conversation

bronekot
Copy link

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.

…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.
Copy link
Member

@tomchristie tomchristie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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! 😃

@gnat
Copy link

gnat commented Apr 11, 2020

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.)

@scriptator
Copy link

What's the status on this pull request? Sounds great to me as I am also experiencing performance issues

@Kludex
Copy link
Sponsor Member

Kludex commented Jun 26, 2021

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. 😰

@Kludex Kludex closed this Jun 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants