Adding gzip to spring embedded tomcat

user_s

I'm trying to add gzip compression to my server (reading and writing) I've tried it with (spring boot):

server.tomcat.compression=on
server.tomcat.compressableMimeTypes=application/json,application/xml,text/html,text/xml,text/plain

but when my client sends :

        GZIPOutputStream gzip = new GZIPOutputStream(baos);
        gzip.write(content.getBytes(Charset.forName("UTF8")));
        gzip.close();

with headers :

        Accept-Encoding" - "gzip"
        "Content-Encoding" -  "gzip"

The data reaches the service still compressed. What did I missed?

user_s

I ended up using an existing filter :

  <dependency>
        <groupId>net.sourceforge.pjl-comp-filter</groupId>
        <artifactId>pjl-comp-filter</artifactId>
        <version>1.7</version>
    </dependency>

And added a bean for it (new CompressingFilter())

If anyone had the same problem or knows why it didn't work with the spring boot configuration I would love to know.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

Running Spring Boot application in embedded Tomcat server in Linux

From Dev

How to service external static HTML files in Spring Boot Embedded tomcat?

From Dev

Spring Boot with embedded Tomcat behind Apache proxy

From Dev

Spring Boot jetty/tomcat embedded access log configuration

From Dev

Make EL work with tomcat 7 embedded (using spring MVC)

From Dev

How do I launch a Spring Boot application without the embedded tomcat?

From Dev

Spring Boot / Security - Cannot customize security when running on embedded Tomcat

From Dev

How to create JNDI context in Spring Boot with Embedded Tomcat Container

From Dev

spring boot war without tomcat embedded

From Dev

Running A Spring Boot App (Embedded Tomcat) with SSL and Unencrypted Simultaneously

From Dev

Disable SSLv3 using Spring-Boot and embedded Tomcat

From Dev

How to convert a subdomain to a path with Embedded Tomcat 8 and Spring boot

From Dev

Spring Boot - replace default embedded Tomcat connector

From Dev

Enable session persistence with Spring Boot and embedded Tomcat

From Dev

Spring Boot war file works with embedded but not with standalone Tomcat

From Dev

How to run hawt.io in spring boot application with embedded tomcat

From Dev

Spring Boot: How to add another WAR files to the embedded tomcat?

From Dev

How do I configure this property with Spring Boot and an embedded Tomcat?

From Dev

Spring boot enable/disable embedded tomcat with profile

From Dev

Is Spring Boot with embedded Tomcat or Jetty Production grade

From Dev

How to setup a Spring Boot application with embedded tomcat session clustering?

From Dev

How to set the logging level of embedded tomcat in Spring Boot?

From Dev

Adding JNDI to embedded Tomcat server in Grails 3

From Dev

Spring boot - Embedded Tomcat

From Dev

How to add a user to an embedded tomcat in a spring boot application?

From Dev

Spring websocket in embedded tomcat 8.0.21

From Dev

Spring 4 + Embedded Tomcat 7

From Dev

Expose resources using Spring embedded tomcat (.jar)

From Dev

Spring Boot, failed to initialise embedded tomcat

Related Related

  1. 1

    Running Spring Boot application in embedded Tomcat server in Linux

  2. 2

    How to service external static HTML files in Spring Boot Embedded tomcat?

  3. 3

    Spring Boot with embedded Tomcat behind Apache proxy

  4. 4

    Spring Boot jetty/tomcat embedded access log configuration

  5. 5

    Make EL work with tomcat 7 embedded (using spring MVC)

  6. 6

    How do I launch a Spring Boot application without the embedded tomcat?

  7. 7

    Spring Boot / Security - Cannot customize security when running on embedded Tomcat

  8. 8

    How to create JNDI context in Spring Boot with Embedded Tomcat Container

  9. 9

    spring boot war without tomcat embedded

  10. 10

    Running A Spring Boot App (Embedded Tomcat) with SSL and Unencrypted Simultaneously

  11. 11

    Disable SSLv3 using Spring-Boot and embedded Tomcat

  12. 12

    How to convert a subdomain to a path with Embedded Tomcat 8 and Spring boot

  13. 13

    Spring Boot - replace default embedded Tomcat connector

  14. 14

    Enable session persistence with Spring Boot and embedded Tomcat

  15. 15

    Spring Boot war file works with embedded but not with standalone Tomcat

  16. 16

    How to run hawt.io in spring boot application with embedded tomcat

  17. 17

    Spring Boot: How to add another WAR files to the embedded tomcat?

  18. 18

    How do I configure this property with Spring Boot and an embedded Tomcat?

  19. 19

    Spring boot enable/disable embedded tomcat with profile

  20. 20

    Is Spring Boot with embedded Tomcat or Jetty Production grade

  21. 21

    How to setup a Spring Boot application with embedded tomcat session clustering?

  22. 22

    How to set the logging level of embedded tomcat in Spring Boot?

  23. 23

    Adding JNDI to embedded Tomcat server in Grails 3

  24. 24

    Spring boot - Embedded Tomcat

  25. 25

    How to add a user to an embedded tomcat in a spring boot application?

  26. 26

    Spring websocket in embedded tomcat 8.0.21

  27. 27

    Spring 4 + Embedded Tomcat 7

  28. 28

    Expose resources using Spring embedded tomcat (.jar)

  29. 29

    Spring Boot, failed to initialise embedded tomcat

HotTag

Archive