Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PROD-2768 Add Gzip Middleware #5307

Draft
wants to merge 1 commit into
base: release-2.43.2
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/fides/api/app_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from typing import AsyncGenerator, List

from fastapi import APIRouter, FastAPI
from fastapi.middleware.gzip import GZipMiddleware
from fastapi.routing import APIRoute
from loguru import logger
from redis.exceptions import RedisError, ResponseError
Expand Down Expand Up @@ -82,6 +83,7 @@ def create_fides_app(
# Starlette bug causing this to fail mypy
fastapi_app.add_exception_handler(FunctionalityNotConfigured, handler) # type: ignore
fastapi_app.add_middleware(SlowAPIMiddleware)
fastapi_app.add_middleware(GZipMiddleware, minimum_size=1000, compresslevel=5)

for router in routers:
fastapi_app.include_router(router)
Expand Down
Loading