Skip to content

Commit

Permalink
Compress middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaczero committed Apr 3, 2024
1 parent 4e453ce commit 83eb7a9
Show file tree
Hide file tree
Showing 4 changed files with 722 additions and 2 deletions.
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

0 comments on commit 83eb7a9

Please sign in to comment.