I created configuration to compress responses with spring boot. Below is my configuration.
@Bean
public ServerProperties serverProperties() {
final ServerProperties serverProperties = new ServerProperties();
serverProperties.getCompression().setMimeTypes(new String[] {"text/html","text/xml","text/plain","text/css","application/json"});
serverProperties.getCompression().setEnabled(true);
return serverProperties;
}
The problem is that all responses have header [Content-Encoding →gzip], even this with smaller response size than min response size, which is 2048 bytes by default.