Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Enabling gzip with Tomcat and SmartGWT

    Hi all,

    'm using SmartClient Version: v8.2p_2012-09-01/LGPL Development Only (built 2012-09-01) and I'm trying to enable gzip compression. If I'm doing it locally through Apache, everything works great. The problem is that on the server, I only have Tomcat installed. When I add the gzip directive to the server.xml and an appropriate Connector, only text gets gzipped, but not JavaScript. This is what I'm using:

    Code:
    <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443"
               compression="on" compressionMinSize="2048" 
               compressableMimeType="text/html,text/xml,text/javascript,text/css,application/javascript"  />
    Edit: I noticed that the *.nocache.js and ISC_RichTextEditor.js get gzipped but e.g. ISC_Calendar.js doesnt.
    Last edited by gImperator; 2 Sep 2013, 10:40.

    #2
    It was a Tomcat issue

    So the problem is in Tomcat, from the answer at http://grokbase.com/t/tomcat/users/111d593qft/tomcat-6-0-gzip-compression-not-working-for-large-js-files:

    Maybe those are sent by "sendfile" and thus avoid being compressed.
    There is certain size threshold (48 Kb, set by sendfileSize parameter
    on DefaultServlet)

    Try to set useSendfile="false" on your Connector.

    And that was the solution.

    Comment

    Working...
    X