users@glassfish.java.net

Re: Gzip compression in Glassfish 3 - doesn't work

From: Richard Kolb <rjdkolb_at_gmail.com>
Date: Wed, 7 Sep 2011 07:58:09 +0200

Hi BradVido

From you stack overflow, you asked :
*> Why does it need to be enabled on both when I am only using the one
listener? Is this a bug? My preliminary tests show that this didn't change
anything for me. – bradvido <http://stackoverflow.com/users/261088/bradvido> 9
hours ago*

Indeed you are correct, you only need to set the first listener since the
other one is for 8181

I set only the first listener only and got the following :


Response Headers


*Content-Encoding:gzipContent-Type:text/html*;charset=UTF-8Date:Wed, 07 Sep
2011 05:44:14 GMTServer:GlassFish Server Open Source Edition
3.1.1-SNAPSHOTTransfer-Encoding:chunkedVary:Accept-EncodingX-Powered-By:JSP/2.2

Is you active config the 'server config' (it is this by default, you can
click on configurations to see this) ?

regards
Richard


On 6 September 2011 15:58, Richard Kolb <rjdkolb_at_gmail.com> wrote:

> Hi BradVido
>
> I think this is indeed your issue.
> I tried this on Glassfish 3.1.1
>
> Enabled both listeners to 'force' and set 'Compression Minimum Size: ' to 1
> for both
>
> Then I created a new project and added your jsp code as 'newjsp.jsp'
>
> This is the output from the FireFox 5 'Web Console' :
>
> Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.7
> *Accept-Encoding:gzip, deflate*
> Accept-Language:en-us,en;q=0.5Connection:keep-aliveHost:localhost:8080User-Agent:Mozilla/5.0
> (X11; Linux x86_64; rv:6.0.1) Gecko/20100101 Firefox/6.0.1
>
> Hope it helps
> regards
> Richard
>
>
>
>
> On 6 September 2011 15:43, Richard Kolb <rjdkolb_at_gmail.com> wrote:
>
>> Hi BradVido
>>
>> On 25 August 2011 22:42, <forums_at_java.net> wrote:
>>
>>> I'm trying to figure out why enabling Gzip compression to forced will not
>>> Gzip my test .jsp page.
>>>
>>> See this video here: youtu.be/uAza4m3fxpY [1]
>>>
>>> Also, I posted details to my question on stackoverflow:
>>> stackoverflow.com/questions/**7193374/glassfish-3-gzip-**
>>> compression-does-not-work-for-**jsp<http://stackoverflow.com/questions/7193374/glassfish-3-gzip-compression-does-not-work-for-jsp>
>>> [2]
>>>
>>> Does anyone have an idea why it's not compressing?
>>>
>>
>> Thanks for the video.
>> I remember this came up before Glassfish 3.0 was released as a part of
>> FishCAT.
>>
>> I think the problem you are having is because you are only setting the one
>> listener 'http-listener-1' and you need to set 'http-listener-2' as well.
>> (perhaps you did this, but did not show it in the video ?)
>>
>> If all else fails, please send your domain.xml
>>
>> regards
>> Richard.
>>
>
>