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
Add support for Zstandard to the Compression middleware #10660
base: master
Are you sure you want to change the base?
Conversation
f8a5a65
to
fb82698
Compare
fb82698
to
849b3a5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The package compresshandler
should be merged with compress
.
My suggestions will produce a non-working code because more changes are required (like the remove of the package compresshandler
)
Also compression_handler.go
and compression_wrapper.go
should be merged in one file compression_handler.go
.
pkg/middlewares/compress/compresshandler/compression_wrapper.go
Outdated
Show resolved
Hide resolved
pkg/middlewares/compress/compresshandler/compression_handler.go
Outdated
Show resolved
Hide resolved
pkg/middlewares/compress/compresshandler/compression_handler.go
Outdated
Show resolved
Hide resolved
pkg/middlewares/compress/compresshandler/compression_handler.go
Outdated
Show resolved
Hide resolved
pkg/middlewares/compress/compresshandler/compression_handler.go
Outdated
Show resolved
Hide resolved
pkg/middlewares/compress/compresshandler/compression_handler.go
Outdated
Show resolved
Hide resolved
pkg/middlewares/compress/compresshandler/compression_handler.go
Outdated
Show resolved
Hide resolved
pkg/middlewares/compress/compresshandler/compression_handler.go
Outdated
Show resolved
Hide resolved
pkg/middlewares/compress/compresshandler/compression_handler.go
Outdated
Show resolved
Hide resolved
pkg/middlewares/compress/compresshandler/compression_handler.go
Outdated
Show resolved
Hide resolved
Co-authored-by: Ludovic Fernandez <[email protected]>
Co-authored-by: Ludovic Fernandez <[email protected]>
Co-authored-by: Ludovic Fernandez <[email protected]>
Co-authored-by: Ludovic Fernandez <[email protected]>
Add support for logging compression error
Avoid duplication of setting the algo, it was forgotten in the first version of the code.
@ldez Ready for second round of review. For the test suite, I don't think all test case beneficiate from iterating through all the compression algo especially when they are testing that the compression isn't used. Other than that, I've merge together the handler and wrapper, used your suggested logic for it (way cleaner, thank you for it). |
This make the middleware fails. It should be logged as an error.
Co-authored-by: Ludovic Fernandez <[email protected]>
Co-authored-by: Ludovic Fernandez <[email protected]>
Co-authored-by: Ludovic Fernandez <[email protected]>
29d9c42
to
8cfe7d5
Compare
I will add an extra commit to your PR, related to a refactor, but not directly related to the code of your PR. |
@ldez It seems GitHub still state that the PR needs some changes ? I imagine since you have added the refactor of CompressHandler, that this is just forgetting to approve the PR ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What does this PR do?
This PR will add support for Zstandard compression when browser state they support it.
It will take precedence on any other compression algorithm like brotli and gzip.
I also refactored the code of the Brotli compression to have only one compression handler for Brotli and Zstandard to simplify the maintenance and reduce the chance of new bug being introduced.
Motivation
Request was made for the feature, and I'm sure this will make traefik one of the first server supporting the zstd compression algorithm.
Fixes #10557
More
Additional Notes