quality@glassfish.java.net

Fwd: gzip compression

From: Felipe Gaścho <fgaucho_at_gmail.com>
Date: Mon, 26 Oct 2009 19:22:14 +0100

Anyone can clarify this for me ? (please check below the confuse
thread in the users list)

I am trying to enable compression in GFv3 b69

what exactly the domain.xml shold looks like ?



      <network-config>
        <protocols>
          <protocol name="http-listener-1">
            <http default-virtual-server="server"
max-connections="250" compression="true" compressionMinSize="1500"
server-name="">
              <file-cache enabled="false" />
              <property name="compressableMimeType"
value="text/html,text/xml,text/plain,image/gif,image/jpeg,image/png,text/css,text/javascript,application/json,application/xml"
/>
            </http>
          </protocol>

???



---------- Forwarded message ----------
From: Nandini Ektare <Nandini.Ektare_at_sun.com>
Date: Mon, Oct 26, 2009 at 7:20 PM
Subject: Re: gzip compression
To: users_at_glassfish.dev.java.net


Hmm..bean validation does not treat compression as boolean. Did anyone
change this ?

In Grizzly 1_9_18e branch (latest one integrated into v3) we have

Http.java
    @Attribute(defaultValue = "false", dataType = String.class)
    String getCompression();

    void setCompression(String compression);

In latest GFv3 trunk we have

There is a property compression in HttpListener.java which is also not
constrained as specified.
    @PropertyDesc(name="compression", defaultValue="off",
values={"off","on","force"},
        description="Specifies use of HTTP/1.1 GZIP compression to
save server bandwidth. " +
            "A positive integer specifies the minimum amount of data
required before the output is compressed. " +
            "If the content-length is not known, the output is
compressed only if compression is set to 'on' or 'force'" ),

-Nandini

Jan Luehe wrote:

On 10/26/09 03:59, w.rittmeyer_at_jsptutorial.org wrote:

Hi Felipe,

I do not know for sure if this is the reason for your problem, but the
attribute "compression" is now of type boolean.

Maybe you should try to use "true" instead.

See the output of asadmin set:

asadmin> set server.network-config.protocols.protocol.http-listener-1.http.compression=force
com.sun.enterprise.admin.cli.CommandException: remote failure: Could
not change the attributes: org.jvnet.hk2.config.ValidationException:
Validation Failed: force is not of data type: java.lang.Boolean
org.jvnet.hk2.config.ValidationException: Validation Failed: force is
not of data type: java.lang.Boolean

Command set failed.
asadmin> set server.network-config.protocols.protocol.http-listener-1.http.compression=true
server.network-config.protocols.protocol.http-listener-1.http.compression=true

Command set executed successfully.

Afterwards in the domain.xml I see >>compression="true"<<.

This seems like a regression.

According to:

  http://weblogs.java.net/blog/jfarcand/archive/2006/06/enabling_http_c_1.html

  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).

Felipe, can you file a bug against "configuration"?

Thanks,


Jan



--
Wolfram Rittmeyer
"Felipe Gaścho" <fgaucho_at_gmail.com> hat am 25. Oktober 2009 um 15:29
geschrieben:
> following this manual: http://docs.sun.com/app/docs/doc/820-4507/abhco?a=view
>
> the "http-listener" should be under the http-service element, right ?
>
>   <configs>
>     <config name="server-config">
>       <http-service>
>         <access-log />
>         <virtual-server id="server"
> network-listeners="http-listener-1,http-listener-2" />
>         <virtual-server id="__asadmin" network-listeners="admin-listener" />
>               <http-listener>
>                 <property name="compression" value="force"/>
>                 <property name="compressableMimeType"
> value="text/html,text/xml,text/plain,image/gif,image/jpeg,image/png,text/css,text/javascript,application/json,application/xml"/>
>               </http-listener>
>       </http-service>
> ...
>
> and nothing happens.. what is missed ?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
-- 
Looking for a client application for this service:
http://fgaucho.dyndns.org:8080/arena-http/wadl