From 2a226f114265e9e6c9241b4a1658fbc2bc46f22e Mon Sep 17 00:00:00 2001 From: popcorny Date: Wed, 29 May 2024 16:49:11 +0800 Subject: [PATCH] Add gzip compression Signed-off-by: popcorny --- recce/server.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recce/server.py b/recce/server.py index 0853b242..c8d94168 100644 --- a/recce/server.py +++ b/recce/server.py @@ -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 @@ -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,