Newer micronaut versions have settings to disable compression in responses by setting the compression-threshold = -1 or compression-level to 0. Older versions don't support this in the DefaultHttpCompressionStrategy.
The workaround is to create a CustomHttpCompressionStrategy as follows:
@Primary
@Singleton
public class CustomHttpCompressionStrategy implements HttpCompressionStrategy {
public boolean shouldCompress(io.netty.handler.codec.http.HttpResponse response) {
return false;
}
public int getCompressionLevel() {
return 0;
}
}