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

feat: Support gzip #153

Merged
merged 1 commit into from
Jun 25, 2024
Merged

feat: Support gzip #153

merged 1 commit into from
Jun 25, 2024

Conversation

andyland
Copy link
Contributor

@andyland andyland commented Jun 25, 2024

Before submitting
  • Was this discussed/agreed via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure to update the docs?
  • Did you write any new necessary tests?

What does this PR do?

This adds a gzip middleware to fast api for non-streaming responses. This will reduce the number of bytes that needs transmitted over the wire for clients that support it.

FastAPI's provided middleware for this does not play nice with streaming so that is excluded. It unfortunately waits until the connection is closed and sends all data at once.

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in GitHub issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

Copy link

codecov bot commented Jun 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80%. Comparing base (c469a13) to head (9caaad0).

Additional details and impacted files
@@         Coverage Diff         @@
##           main   #153   +/-   ##
===================================
  Coverage    80%    80%           
===================================
  Files        13     13           
  Lines       985    988    +3     
===================================
+ Hits        792    795    +3     
  Misses      193    193           

@andyland andyland enabled auto-merge (squash) June 25, 2024 07:13
Copy link
Collaborator

@aniketmaurya aniketmaurya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@andyland andyland merged commit 3e5bb40 into main Jun 25, 2024
18 of 19 checks passed
@andyland andyland deleted the andy/gzip branch June 25, 2024 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants