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

Introduce CompressionHandler to support compression from gzip, brotli, and zstandard #8769

Open
joakime opened this issue Oct 26, 2022 · 6 comments · Fixed by #12075
Open
Assignees
Labels
Enhancement Sponsored This issue affects a user with a commercial support agreement

Comments

@joakime
Copy link
Contributor

joakime commented Oct 26, 2022

Jetty version(s)
Jetty 12

Enhancement Description
The current GzipHandler does a good job at handling Content-Encoding: gzip (and Accept-Encoding: gzip), but we shouldn't hardcode only gzip support.

Can we refactor the existing GzipHandler to be more generic, something like DynamicCompressionHandler and have the Gzip support (courtesy of the existing GzipRequest object) just be loaded via a ServiceLoader?

This way we can encourage other compression algorithms under the same Accept-Encoding / Content-Encoding / already compressed rules that the existing codebase handles for us?

Other compression algorithms that have been requested in our issue tracker.

(FYI, curl supports both of these compression types now)

@github-actions
Copy link

This issue has been automatically marked as stale because it has been a
full year without activity. It will be closed if no further activity occurs.
Thank you for your contributions.

@github-actions github-actions bot added the Stale For auto-closed stale issues and pull requests label Oct 27, 2023
@joakime joakime removed the Stale For auto-closed stale issues and pull requests label Oct 27, 2023
@joakime
Copy link
Contributor Author

joakime commented Apr 25, 2024

@joakime joakime added the Sponsored This issue affects a user with a commercial support agreement label Apr 25, 2024
@gregw gregw removed the Jetty 12 label May 1, 2024
@gregw
Copy link
Contributor

gregw commented May 26, 2024

@joakime lets start working on this in the 12.1.x branch

@joakime
Copy link
Contributor Author

joakime commented Jun 5, 2024

I'm working on this now.

@joakime
Copy link
Contributor Author

joakime commented Aug 20, 2024

I've got the basics of the Compression API done.
Including the Encoders as Content.Sink, and Decoders as Content.Source.
The DynamicCompressionHandler (needs a new name, perhaps CompressionHandler ?) can do the basics right now.

What's left ...

  • CompressionHandler Config
  • Encoder Config
  • Decoder Config
  • Compressions (plural) as single object to find/use/manage all compressions available (ServiceLoader? bean on Server? bean on Client?)
  • Dictionary Support for Encoders and Decoders
  • HTTP Shared Dictionary support in CompressionHandler - see https://datatracker.ietf.org/doc/draft-ietf-httpbis-compression-dictionary/
  • jetty start modules for CompressionHandler
  • XML examples of configuration of CompressionHandler with examples:
  • More testing around error handling of failures during Encoder / Decoder with a focus on cleanup / release.
  • Decide if we want to support multiple entire encodings on Decoder or not (I vaguely recall this coming up for GzipHandler where the content was 2 entire Gzip blocks, with headers + data + trailers, one after the other, but coalesced into a single decode. This is awkward at best for Gzip, and totally not supported for brotli and zstandard)
  • Documentation for all of the above.

@joakime
Copy link
Contributor Author

joakime commented Aug 20, 2024

@gregw lets have a chat about the remaining tasks.

@joakime joakime changed the title Refactor GzipHandler into DynamicCompressionHandler and allow ServiceLoader to find other implementations Introduce CompressionHandler to support compression from gzip, brotli, and zstandard Aug 21, 2024
@gregw gregw moved this from 🏗 In progress to ✅ Done in Jetty 12.1.0 Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Sponsored This issue affects a user with a commercial support agreement
Projects
Status: ✅ Done
2 participants