Using Gzip Compression with Spring Boot/Mvc/Javaconfig with Restful

How to enable GZIP for RestController?

If you are using Spring boot and Tomcat You should be able to accomplish this via Tomcat Configuration:
http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#how-to-enable-http-response-compression

Here is a similar POST Using GZIP compression with Spring Boot/MVC/JavaConfig with RESTful

It's as simple as follows:

server.compression.enabled=true
server.compression.mime-types=application/xml

Compression is not working in spring but, it is showing Content-Encoding as gzip in the response headers

This might be the issue when we test with postman, as asked here, so inorder to verify, i tried with chrome and i got the compressed size(transfered over network) and also the actual size which is displayed as (resource size), along with the header "Content-Encoding" as "gzip".

Spring-boot enable compression for non-embedded containers

It is not possible without any extra configuration. The spring-boot configuration works for the embedded containers.



Related Topics



Leave a reply



Submit