Skip to content

AIP-84 Add gzip middleware to fastapi server #43640

@tirkarthi

Description

@tirkarthi

Description

Fastapi provides gzip middleware to compress responses. This could be done at the load balancer level (nginx) but it will be good to have this enabled since the fastapi server mostly serves JSON responses. This can make the frontend more responsive with shorter download times. E.g. 75 dags list page results in 50kB which on adding gzip middleware becomes 5kB. There was a proposal for the same in the flask webserver which required flask compress but fastapi has this without third party packages. We use this in production for legacy webserver views and it greatly speeds up the page loading times and also makes heavy calls like log download during auto refresh more efficient.

Ref PR for legacy webserver : #13517
https://fastapi.tiangolo.com/advanced/middleware/#gzipmiddleware

Use case/motivation

No response

Related issues

No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions