Skip to content

Commit

Permalink
Enable gzip-compressing middleware (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
goncalossilva authored Nov 9, 2023
1 parent 69e01a5 commit 24a7e29
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from fastapi import FastAPI, Header
from fastapi.middleware.cors import CORSMiddleware
from fastapi.middleware.gzip import GZipMiddleware
from fastapi.responses import ORJSONResponse
from flag_engine.engine import (
get_environment_feature_state,
Expand Down Expand Up @@ -133,4 +134,5 @@ async def refresh_cache():
allow_methods=["*"],
allow_headers=["*"],
)
app.add_middleware(GZipMiddleware, minimum_size=1000)
app.include_router(sse_router)

0 comments on commit 24a7e29

Please sign in to comment.