-
1. Re: GZip compression for connector in JBoss 7.0.x
Chuck May Sep 28, 2011 2:48 PM (in response to Chuck May)After more searching, it just seems like the built in compression options were removed in AS7 with no mention in any changelog that I could find. Specifically it should have shown up in the migration document:
In the end, we just had to add a compression filter to web.xml. We ended up using the one at:
https://code.google.com/p/webutilities/wiki/CompressionFilter
Pretty straightforward.
-
2. Re: GZip compression for connector in JBoss 7.0.x
Humberto Ferreira da Luz Jr. Dec 9, 2011 7:31 AM (in response to Chuck May)No news about gzip compression in JBoss AS 7?
-
3. Re: GZip compression for connector in JBoss 7.0.x
Humberto Ferreira da Luz Jr. Dec 21, 2011 8:42 AM (in response to Humberto Ferreira da Luz Jr.)I created a feature request for the issue: https://issues.jboss.org/browse/AS7-2991
-
4. Re: GZip compression for connector in JBoss 7.0.x
varkon Mar 29, 2012 4:39 AM (in response to Chuck May)According to that issue (that seems to be fixed in version 7.1.1.Final), compression is now enabled. However, I cannot find any trace of documentation on how to enable it.
Does anybody have any information on that?
Thanks.
-
5. Re: GZip compression for connector in JBoss 7.0.x
Humberto Ferreira da Luz Jr. Mar 29, 2012 7:14 AM (in response to varkon)I thought that could be like this:
<server name="xyz.home" xmlns="urn:jboss:domain:1.0"> <extensions> <extension module="org.jboss.as.clustering.infinispan"/> <extension module="org.jboss.as.clustering.jgroups"/> <extension module="org.jboss.as.connector"/> .... <extension module="org.torquebox.web"/> </extensions> <system-properties> <property name="org.apache.coyote.http11.Http11Protocol.COMPRESSION" value="true"/> </system-properties>
But that didn't worked out for me.
-
6. Re: GZip compression for connector in JBoss 7.0.x
varkon Mar 29, 2012 7:51 AM (in response to Chuck May)I know, I tried that, as well as passing it as a parameter during startup (which should be the same thing).
-
7. Re: GZip compression for connector in JBoss 7.0.x
Hendy Irawan Mar 29, 2012 2:54 PM (in response to varkon)Doing this is not working :
<subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="false">
<connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"
compression="on" compressableMimeType="text/html,text/xml,text/css,text/javascript, application/x-javascript,application/javascript" />
<virtual-server name="default-host" enable-welcome-root="true">
<alias name="localhost"/>
<alias name="example.com"/>
</virtual-server>
</subsystem>
Error :
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[259,13]
Message: JBAS014788: Unexpected attribute 'compression' encountered
at org.jboss.as.controller.parsing.ParseUtils.unexpectedAttribute(ParseUtils.java:104) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.web.WebSubsystemParser.parseConnector(WebSubsystemParser.java:820)
at org.jboss.as.web.WebSubsystemParser.readElement(WebSubsystemParser.java:325)
at org.jboss.as.web.WebSubsystemParser.readElement(WebSubsystemParser.java:65)
at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110) [staxmapper-1.1.0.Final.jar:1.1.0.Final]
-
8. Re: GZip compression for connector in JBoss 7.0.x
varkon Apr 2, 2012 7:15 AM (in response to Chuck May)To quote from the jira associated with this thread,
{quote}-Dorg.apache.coyote.http11.Http11Protocol.COMPRESSION=on{quote}
Seems to enable HTTP compression. I'm only re-posting it here for clarity.
Thanks.
-
9. Re: GZip compression for connector in JBoss 7.0.x
Humberto Ferreira da Luz Jr. Apr 3, 2012 8:53 AM (in response to varkon)Are you sure Dimitris? I tried running jboss like "./standalone -Dorg.apache.coyote.http11.Http11Protocol.COMPRESSION=on", also tried setting it in the system-properties (standalone.xml), but Pagespeed (firefox addon) changed the compression score from 0 to 2 (out of 100). Is there anything else I should be doing?
-
10. Re: GZip compression for connector in JBoss 7.0.x
varkon Apr 9, 2012 4:21 AM (in response to Humberto Ferreira da Luz Jr.)In truth, I've only set the compression flag to "on".
My requests contain the "Accept-Encoding: gzip,deflate" header. After setting the flag, my tests reply with "Content-Encoding: gzip".
-
11. Re: GZip compression for connector in JBoss 7.0.x
Humberto Ferreira da Luz Jr. Apr 9, 2012 10:02 AM (in response to varkon)You're right Dimitris, my requests also contain the gzip header, but have you realized any diference? The size of the pages are really smaller? Pagespeed plugin still points me that the compressing is disabled.
-
12. Re: GZip compression for connector in JBoss 7.0.x
Hendy Irawan Apr 9, 2012 11:16 AM (in response to Humberto Ferreira da Luz Jr.)Check it out for yourself :
ceefour@annafi:~$ curl --raw --compressed -s http://localhost:9080/ -o - | wc -c
1259
ceefour@annafi:~$ curl --raw -s http://localhost:9080/ -o - | wc -c
2432
So, yes, JBoss 7.1.1 HTTP compression is definitely working for me.
-
13. Re: GZip compression for connector in JBoss 7.0.x
Samuel Santos May 4, 2012 11:19 AM (in response to Hendy Irawan) -
14. Re: GZip compression for connector in JBoss 7.0.x
emollient mind Oct 17, 2012 3:15 PM (in response to Samuel Santos)Please add the following system properties for enabling gzip and serving gzipped content
file : standalone.xml (JBoss AS 7+ )
Position : right after
<extensions>
</extensions>
<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,text/xml,text/json"/> <!-- add other content types you want to gzip -->
</system-properties>
Note : Please install YSlow firebug plugin to see gzip in action else you may not know even if gzipping is working.
Appreciate if any idea on enabling pre gzipped js or css serving to browsers in JBoss AS 7 series
regards