Enable GlassFish Compression
How to enable glass fish compression?开发者_如何学Python I enabled compression in http-lister properties but no changed response
- Login to admin console:
localhost:4848
- Go to the
Network Config
>Network Listener
- Select the listener for which you want to enable gzip > HTTP Tab
- Check if you have min compression size set. I don't remember from the top of my head if glassfish has a default min compression size. Pretty much if the resource does not exceed this value in size, it won't be compressed.
- Check if you have correct compressableMimeType set. application/xml is not the same as text/xml, even if they're really both XMLs.
Responses to HTTP requests in version 1.0 are not compressed. You must send your requests in HTTP 1.1 to get gzipped responses from your glassfish server.
More over, you must add the header "Accept-Encoding: gzip" in your http requests.
精彩评论