Forum Stats

  • 3,852,812 Users
  • 2,264,140 Discussions
  • 7,905,150 Comments

Discussions

Anyone got ORDS + Tomcat to work with gzip compression?

Hello fellow ORDS users,

Is anyone successfully getting gzip compression to work with ORDS and Tomcat?

I have enabled compression on the Tomcat server and I can see that it is working for regular text/html content. The response headers contain:

Content-Encoding: gzip

Also I can see that the size of the transferred data is reduced.

When I try this for an ORDS route where the response contains a JSON payload I don't get the compression at all. The size of the response doesn't change and the Response Headers don't change. I can see the Content-Type is application/json and that is listed in my compressibleMimeType.

My Connector config is as follows:

<Connector port="8080" 
      protocol="HTTP/1.1"
      connectionTimeout="20000"
      redirectPort="8443"
      compression="on"
      compressionMinSize="2048"
      noCompressionUserAgents="gozilla, traviata"
      useSendfile="false"
      compressibleMimeType="text/html,text/xml,text/plain,text/css,text/javascript,application/javascript,application/json"
/>

I've tried numerous variations on the min size, with/without useSendfile - no joy.

I can't figure out what I'm missing. Any help gratefully appreciated.

Cheers,

John 

Tagged:

Answers

  • John Howard
    John Howard Member Posts: 32 Bronze Badge

    No-one out there with any successful experience of this?

    Or is anyone else having the same problem as me?

    Any insight appreciated.

    Cheers,

    John

  • John Howard
    John Howard Member Posts: 32 Bronze Badge

    No-one out there with any insight into this at all?

    Are people just not doing it?

    Or is just so trivially simple and I'm missing something really obvious.

    Would appreciate any feedback at all even it's just to point out what a dumb*ss I am

  • kdario
    kdario Member Posts: 3,533 Silver Crown

    For intranet apps, http compression is usually unnecessary and just introduces overhead, and for apis exposed over internet, features like http compression, ssl termination, etc. are usually done on reverse proxy, api gateway and similar software.

    Regarding question why compression doesn't work on tomcat, my best guess is that your ORDS Handler has ETag.

    Tomcat will not compress http response with Strong ETag so you can try to disable it and see if this will make any difference.


    Regards,

    Dario

  • Olafur T
    Olafur T Member Posts: 244 Bronze Badge

    Personally I use NGINX to proxy ORDS for the internet, There the compression is being done.

    Added bonus is being able to selectively pick which services are open to the public. I.e. location /api/ -> /ords/pool/schema/api/