-
-
Notifications
You must be signed in to change notification settings - Fork 652
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
Support for brotli (br
) compression in compress middleware
#3543
Comments
I think it's not bad since edge runtime etc. also supports this feature. (but, it's not supportted on service-worker as browser's features) |
Compress middleware relies on CompressionStream which does not support Brotli yet unfortunately. Good news is that W3C TPAC is going to add Brotli to the standard.
|
planning to ship! Looks good. |
How about Zstandard? 😉 |
Brotli coming to the standards is good news indeed! I am guessing our only workaround for now is to clone the middleware, replace the bits and pieces to fit our node runtime, and wait until we can use the 'native' way? |
In the meantime I made my own plugin, with blackjack and hookers! 🤖 |
What is the feature you are proposing?
We're trying to modernize our app with Hono, but we'd like to use brotli compression for responses, instead of just gzip. Ssome of our calls can be a couple megabytes compressed, and the ratio between gzip and brotli is quite different.
From what I can tell, the list of supported compression algorithms is hard-coded:
hono/src/middleware/compress/index.ts
Line 9 in f8664b0
hono/src/middleware/compress/index.ts
Line 23 in f8664b0
The node
zlib
package supports brotli, which should make it possible to implement it without an additional third party dependency.Also, if there is a way to use the
text
mode for brotli for when the content is JSON or other text-only stuff would be great.The text was updated successfully, but these errors were encountered: