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

encode: try to use sendfile when compression is not used #6749

Merged
merged 5 commits into from
Dec 20, 2024
Merged

Conversation

WeidiDeng
Copy link
Member

Whenever Accept-Encoding: gzip or the like is included in the request headers and encode is enabled, currently there is no way for sendfile to be used even if the response is not compressed.

This patch attempts to fix this by implementing io.ReaderFrom. Similar to 5022.

Copy link
Member

@mholt mholt left a comment

Choose a reason for hiding this comment

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

Thanks Weidi! Looking forward to seeing how this works, but I do have a question.

modules/caddyhttp/encode/encode.go Show resolved Hide resolved
Copy link
Member

@mholt mholt left a comment

Choose a reason for hiding this comment

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

Thanks for the comments. Let's give it a try then :)

@mholt mholt enabled auto-merge (squash) December 20, 2024 21:30
@mholt mholt added this to the v2.9.0-beta.4 milestone Dec 20, 2024
@mholt mholt merged commit 5ba1e06 into master Dec 20, 2024
33 checks passed
@mholt mholt deleted the encode-sendfile branch December 20, 2024 21:37
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