When I enabled http2, content is no longer gzip compressed.
Versions: 2.4.3
Here's an example configuation...
final WebappContext context = new WebappContext("myservice", "");
final boolean start = false;
// Create the server
final HttpServer server = GrizzlyHttpServerFactory.createHttpServer(BASE_URI, start);
final NetworkListener listener = server.getListeners().iterator().next();
// Configure SSL
final SSLEngineConfigurator sslConfig = getSslConfig(config);
listener.setSecure(true);
listener.setSSLEngineConfig(sslConfig);
// Create default HTTP/2 configuration and provide it to the AddOn
final Http2Configuration configuration = Http2Configuration.builder().build();
final Http2AddOn http2Addon = new Http2AddOn(configuration);
listener.registerAddOn(http2Addon); // This will break gzip
...
// Gzip compression
final CompressionConfig compression = listener.getCompressionConfig();
compression.setCompressionMode(CompressionConfig.CompressionMode.ON);
compression.setCompressionMinSize(1);
compression.setCompressibleMimeTypes(ImmutableSet.<String> builder()
.add("text/plain")
.add("text/html")
.add("text/css")
.add("text/javascript")
.build());
context.deploy(server);
return server;
When I enabled http2, content is no longer gzip compressed.
Versions: 2.4.3
Here's an example configuation...