Skip to content

Commit

Permalink
馃摑 Add missing compresslevel parameter on docs
Browse files Browse the repository at this point in the history
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
  • Loading branch information
junah201 committed Mar 26, 2024
1 parent b0dd4f7 commit 43f2b2d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/en/docs/advanced/middleware.md
Expand Up @@ -85,6 +85,7 @@ The middleware will handle both standard and streaming responses.
The following arguments are supported:

* `minimum_size` - Do not GZip responses that are smaller than this minimum size in bytes. Defaults to `500`.
* `compresslevel` - Used during GZip compression. It is an integer ranging from 1 to 9. Defaults to `9`. Lower value results in faster compression but larger file sizes, while higher value results in slower compression but smaller file sizes.

## Other middlewares

Expand Down
2 changes: 1 addition & 1 deletion docs_src/advanced_middleware/tutorial003.py
Expand Up @@ -3,7 +3,7 @@

app = FastAPI()

app.add_middleware(GZipMiddleware, minimum_size=1000)
app.add_middleware(GZipMiddleware, minimum_size=1000, compresslevel=9)


@app.get("/")
Expand Down

0 comments on commit 43f2b2d

Please sign in to comment.