Navigation Menu

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

Add compresslevel to GZipMiddleware #1128

Merged
merged 7 commits into from Jun 11, 2021
Merged

Add compresslevel to GZipMiddleware #1128

merged 7 commits into from Jun 11, 2021

Conversation

andamound
Copy link
Contributor

@andamound andamound commented Jan 19, 2021

starlette/middleware/gzip.py Outdated Show resolved Hide resolved
starlette/middleware/gzip.py Outdated Show resolved Hide resolved
Current default level = 9
New default level = 1

Documentation gzip: https://docs.python.org/3/library/gzip.html
Benchmarks: https://tukaani.org/lzma/benchmarks.html

Reformate code

Default compress level in gzip now = 9
@Kludex
Copy link
Sponsor Member

Kludex commented Jun 11, 2021

@andamound Thanks for your PR! 🎉

Just for the record, I think the GZipResponder class should not have a default value on compresslevel, as it's meant to be used by the GZipMiddleware. But as we expose the API of that module as is, I think it's better to not add breaking changes unnecessarily.

@Kludex Kludex merged commit 467eb1c into encode:master Jun 11, 2021
Kludex added a commit that referenced this pull request Mar 25, 2024
* Add missing compresslevel parameter on docs

The compresslevel parameter was added in #1128.
But, it was not added to the document, so an explanation was added.

* Update docs/middleware.md

---------

Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
junah201 added a commit to junah201/fastapi that referenced this pull request Mar 26, 2024
The compresslevel parameter was added in encode/starlette#1128 encode/starlette#2553
But, it was not added to the document, so an explanation was added
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

4 participants