You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When http compression is enabled, Quarkus defaults to gzip, i.e. when faced with this request header:
> Accept-Encoding: deflate, gzip, br
it responds with gzipped content:
< content-encoding: gzip
Similarly, if the client claims only support for deflate, Quarkus obliges with deflate compressed content:
> Accept-Encoding: deflate
< content-encoding: deflate
Brotli compression is available via brotli4j JNI wrapper and it is a part of Vert.x and it could be used by Quarkus both in Native and HotSpot, see example project. The configuration is cumbersome and requires additional config in user's app. When configured, it works though:
/**
* If user adds br, then brotli will be added to the list of supported compression algorithms.
* It implies loading libbrotli native library via JNI and in case of Native image,
* packing the native library into the native image as a resource thus inflating its size.
* Note that a native shared object library must be available for your platform in Brotli4J project.
*/
@ConfigItem(defaultValue = "gzip,deflate")
public Optional<List<String>> compressionAlgorithms;
EDIT: Actually this does not handle well, because if you would like to remove e.g. deflate, it would require additional substitutions and tweaking in vert.x to actually remove it and that is a "feature" nobody asked for. So it would be much better to call it:
public Optional<List<String>> addCompressors;
And now if it adds br as brotli, the Brotli compressor is added back to Vert.x, where it was removed in the first place in isBrotliAvailable.
...and a corresponding native build steps that would bake resources and init as needed so as user doesn't have to.
WIP...
Implementation ideas
No response
The text was updated successfully, but these errors were encountered:
Karm
changed the title
Web server compression: Make brotli, deflate, gzip configurable (HotSpot and Native)
Web server: Make brotli, deflate, gzip configurable
May 17, 2024
Description
Sparkled by #40533
When http compression is enabled, Quarkus defaults to gzip, i.e. when faced with this request header:
it responds with gzipped content:
Similarly, if the client claims only support for
deflate
, Quarkus obliges with deflate compressed content:Brotli compression is available via brotli4j JNI wrapper and it is a part of Vert.x and it could be used by Quarkus both in Native and HotSpot, see example project. The configuration is cumbersome and requires additional config in user's app. When configured, it works though:
I'd like to add a new option, yet another knob to tune, alongside the existing options here:
I have this cooking now:
EDIT: Actually this does not handle well, because if you would like to remove e.g. deflate, it would require additional substitutions and tweaking in vert.x to actually remove it and that is a "feature" nobody asked for. So it would be much better to call it:
And now if it adds br as brotli, the Brotli compressor is added back to Vert.x, where it was removed in the first place in isBrotliAvailable.
...and a corresponding native build steps that would bake resources and init as needed so as user doesn't have to.
WIP...
Implementation ideas
No response
The text was updated successfully, but these errors were encountered: