Skip to content

Add WithMinLength option to control when responses are gzipped #106

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

takanuva15
Copy link

Enables conditional compression based on response size. The response is stored in a temporary buffer within the gzipWriter if it does not meet the provided limit (required in case the server executes additional writes to the response later in its handler control flow). When the handler finally returns, we check whether the limit was met. If not, the buffer contents are written directly to the underlying gin Writer with no gzip compression.

Credit to #20 for the main implementation details

Closes #18
Closes #20
Closes #34
Closes #81
Resolves part of #70

@takanuva15
Copy link
Author

@appleboy hi, can you please approve the workflows to run tests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant