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

Adding Brotli as a compression option #2646

Closed
kyri-petrou opened this issue Jan 21, 2024 · 6 comments · Fixed by #2857
Closed

Adding Brotli as a compression option #2646

kyri-petrou opened this issue Jan 21, 2024 · 6 comments · Fixed by #2857
Labels

Comments

@kyri-petrou
Copy link
Collaborator

Is your feature request related to a problem? Please describe.

Most browsers support brotli compression, which is a faster alternative to gzip. Netty already supports compressing payloads using brotli compression. It would be nice if zio-http exposed that as a compression option.

The main "issue" with adding this as an option is that this requires an additional dependency on brotli4j. While this could be added as an optional dependency (which is what Netty does), it might require adding some checks during the server initialization to ensure that the user has the dependency installed if they choose it

Describe the solution you'd like

Having Brotli as an additional CompressionType option

Describe alternatives you've considered
N/A

Additional context
N/A

@kyri-petrou kyri-petrou added the enhancement New feature or request label Jan 21, 2024
@jdegoes
Copy link
Member

jdegoes commented Feb 8, 2024

/bounty $75

Copy link

algora-pbc bot commented Feb 8, 2024

💎 $75 bounty • ZIO

Steps to solve:

  1. Start working: Comment /attempt #2646 with your implementation plan
  2. Submit work: Create a pull request including /claim #2646 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Thank you for contributing to zio/zio-http!

Add a bountyShare on socials

Attempt Started (GMT+0) Solution
🟢 @987Nabil #2857

987Nabil added a commit to 987Nabil/zio-http that referenced this issue Feb 8, 2024
987Nabil added a commit to 987Nabil/zio-http that referenced this issue Feb 9, 2024
@Andrapyre
Copy link

Andrapyre commented May 12, 2024

@987Nabil , I haven't tried to run your PR locally, but it looks like you're trying to shade a native library. That will break the JNI binding and, AFAIK, the only way around that is to reimplement the JNI lib yourself. Why is the shading actually necessary here? This lib should probably be provided by the user anyway, since it's a native lib and needs to be built for the correct platform. In that case, you could probably get rid of the shading altogether, specify it as provided, and move on with your implementation.

Do you intend to finish this? If not, I'm happy to take it over.

@987Nabil
Copy link
Contributor

@Andrapyre thanks for the input. I'll take care of it.

987Nabil added a commit to 987Nabil/zio-http that referenced this issue May 20, 2024
Copy link

algora-pbc bot commented May 20, 2024

💡 @987Nabil submitted a pull request that claims the bounty. You can visit your bounty board to reward.

987Nabil added a commit to 987Nabil/zio-http that referenced this issue May 20, 2024
987Nabil added a commit to 987Nabil/zio-http that referenced this issue May 23, 2024
jdegoes pushed a commit that referenced this issue May 24, 2024
* Add brotli compression (#2646)

* Migrate main
Copy link

algora-pbc bot commented May 24, 2024

🎉🎈 @987Nabil has been awarded $75! 🎈🎊

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