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

CompressMiddleware - Supporting ZStd, Brotli, GZip #2564

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ It is production-ready, and gives you the following:
* In-process background tasks.
* Startup and shutdown events.
* Test client built on `httpx`.
* CORS, GZip, Static Files, Streaming responses.
* CORS, Static Files, Streaming responses.
* ZStd, Brotli, GZip response compression.
* Session and Cookie support.
* 100% test coverage.
* 100% type annotated codebase.
Expand Down Expand Up @@ -88,6 +89,8 @@ Starlette only requires `anyio`, and the following are optional:
* [`python-multipart`][python-multipart] - Required if you want to support form parsing, with `request.form()`.
* [`itsdangerous`][itsdangerous] - Required for `SessionMiddleware` support.
* [`pyyaml`][pyyaml] - Required for `SchemaGenerator` support.
* [`brotli`][brotli] or [`brotlicffi`][brotlicffi] - Required for Brotli response compression.
* [`zstandard`][zstandard] - Required for ZStd response compression.

You can install all of these with `pip3 install starlette[full]`.

Expand Down Expand Up @@ -134,6 +137,8 @@ in isolation.
[jinja2]: https://jinja.palletsprojects.com/
[python-multipart]: https://andrew-d.github.io/python-multipart/
[itsdangerous]: https://itsdangerous.palletsprojects.com/
[sqlalchemy]: https://www.sqlalchemy.org
[pyyaml]: https://pyyaml.org/wiki/PyYAMLDocumentation
[techempower]: https://www.techempower.com/benchmarks/#hw=ph&test=fortune&l=zijzen-sf
[brotli]: https://pypi.org/project/Brotli/
[brotlicffi]: https://pypi.org/project/brotlicffi/
[zstandard]: https://python-zstandard.readthedocs.io/
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ full = [
"python-multipart>=0.0.7",
"pyyaml",
"httpx>=0.22.0",
"brotli>=1; platform_python_implementation == 'CPython'",
"brotlicffi>=1; platform_python_implementation != 'CPython'",
"zstandard>=0.15",
]

[project.urls]
Expand Down
Loading