Skip to content

Commit

Permalink
Add gzip compression
Browse files Browse the repository at this point in the history
Signed-off-by: popcorny <[email protected]>
  • Loading branch information
popcornylu committed May 29, 2024
1 parent ed5ea52 commit 2a226f1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions recce/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from fastapi.responses import PlainTextResponse
from fastapi.staticfiles import StaticFiles
from pydantic import ValidationError
from starlette.middleware.gzip import GZipMiddleware
from starlette.middleware.sessions import SessionMiddleware
from starlette.websockets import WebSocketDisconnect

Expand Down Expand Up @@ -89,6 +90,7 @@ def dbt_artifacts_updated_callback(file_changed_event: Any):
"http://localhost:3000",
]

app.add_middleware(GZipMiddleware, minimum_size=1000)
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
Expand Down

0 comments on commit 2a226f1

Please sign in to comment.