GZIP Compression is not woking On jBoss Server Whe

2019-09-08 23:45发布

问题:

I am using GZIP compression technique to compress various files in my application. All the files were getting Gzipped and compressed when I was using them on my local server (jBoss EAP 6.1--Standalone-Full profile) but when I tried to implement that on my server (Linux System) the same is not happening .

I added this in my standalone -- > for windows system .

 <system-properties>
        <property name="org.apache.coyote.http11.Http11Protocol.COMPRESSION" value="on"/>
        <property name="org.apache.coyote.http11.Http11Protocol.COMPRESSION_MIME_TYPES" value="text/javascript,text/css,text/html,application/font-woff,application/json,application/javascript,image/gif"/>
    </system-properties> 

I added this in my linux system profiles also .

Can someone give me a solution Why is it not working on my server (Linux) but working with my local server (Windows System).

回答1:

Caveat: I don't have jBoss to test this.

The first step would be to check the server logs whether it has seen the option and applied it or whether there is an error.

Then you need to check the headers which the client and the server exchange and look for the Accept-Encoding (client) and Content-Encoding (server) header parameters to see whether both support gzip and whether they actually use it. See https://en.wikipedia.org/wiki/HTTP_compression for the protocol.