|
|
||
Jean-Francois Arcand's Blog
«Tricks and Tips with NIO part II: Why SelectionKey.attach() is evil |
Main
| Dynamically Adding Virtual Servers in GlassFish »
Enabling HTTP Compression in GlassFishPosted by jfarcand on June 07, 2006 at 11:33 AM | Comments (4)Glassfish b06 now support HTTP Compression, the same way Tomcat is supporting it. Several options are availaible (from Tomcat docs): compressableMimeType: The value is a comma separated list of MIME types for which HTTP compression may be used. The default value is text/html,text/xml,text/plain. compression: The Connector may use HTTP/1.1 GZIP compression in an attempt to save server bandwidth. The acceptable values for the parameter is "off" (disable compression), "on" (allow compression, which causes text data to be compressed), "force" (forces compression in all cases), or a numerical integer value (which is equivalent to "on", but specifies the minimum amount of data before the output is compressed). If the content-length is not known and compression is set to "on" or more aggressive, the output will also be compressed. If not specified, this attribute is set to "off". noCompressionUserAgents: The value is a comma separated list of regular expressions matching user-agents of HTTP clients for which compression should not be used, because these clients, although they do advertise support for the feature, have a broken implementation. The default value is an empty String (regexp matching disabled). minCompressionSize: The minimum size of a file when compression is applied. You can enable HTTP compression using two approaches: The fastest way is to edit ${glassfish.home}/domains/domain/config/domain.xml, and add, under the http-listener element:
<http-listener>
<property name="compression" value="on"/>
<property name="compressableMimeType" value="...."/>
</http-listener>Or you can using do it using GlassFish admin CLI:
Once Issue 607 is fixed, you gonna be able to use the Admin Gui to configure HTTP compression as well.
technorati: grizzly compression glassfish
% asadmin set server.http-service.http-listener.http-listener-1.
property.compression=forceBookmark blog post: CommentsComments are listed in date ascending order (oldest first) | Post Comment
| ||
|
|