Conversation
markt-asf
left a comment
There was a problem hiding this comment.
Thanks for providing the PR. It has been very thought provoking.
I think we need to look at more than just GZip. Other compression algorithms are available and I think we need a more generic approach. I don't think we should be setting algorithm specific settings in the Protocol. I also don't think they should be set on CompressionCongfig. Speaking of CompressionConfig, are the new getters there used? I looked but couldn't see any calls to them.
I think we might need a new server.xml element for output compression (and possibly one for input compression too). With attributes for className, encoding and algorithm specific attributes. It should be possible to override the default gzip support.
The handling of custom InputFilters might provide some inspiration for OutputFilters.
There are some elements of the PR that can be used as is. I'll start cherry-picking those shortly.
This can be used to control which content encodings will not be compressed when compression is enabled. Based on pull request #914 by Long9725.
This can be used to control which content encodings will not be compressed when compression is enabled. Based on pull request #914 by Long9725.
This can be used to control which content encodings will not be compressed when compression is enabled. Based on pull request #914 by Long9725.
This can be used to control which content encodings will not be compressed when compression is enabled. Based on pull request #914 by Long9725.
|
Apologies for the delayed response — I missed this review earlier. Thank you for the thoughtful feedback. I agree that we should look beyond gzip and move toward a more generic compression approach. Supporting additional algorithms such as Zstandard was also one of the motivations behind this work. My intention was to approach this incrementally in two stages:
I split it this way because the first step felt relatively contained, while the second seemed likely to require broader architectural discussion and potentially significant changes depending on the preferred direction. Given your feedback, would you prefer this PR to remain focused on the incremental improvements, with the broader compression design handled separately, or should this PR evolve toward a more generic compression architecture? Separately, regarding CompressionConfig — one reason I made changes there is that it is also used by the Spring Boot Tomcat integration. While investigating how to make these options configurable from Spring Boot, I found that Tomcat first needs to expose the relevant configuration properties before they can be surfaced on the Spring side. |
Make compression pluggable and configurable (gzip level/buffer), retain API compatibility
Overview
Changes
delegating to gzip.
setNoCompressionEncodings.
Influence