You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Daniel Young <dy...@synyati.com.au> on 2006/11/23 06:56:16 UTC

GZipping (was: Very important JSF issue)

Sorry, me again-   as far as stats go, you could use wget and just check the
resulting file size.

If you are interested in more control, and in caching gzipped responses in
your server, see ehcache:
http://ehcache.sourceforge.net/EhcacheUserGuide.html

It contains a GzipFilter and the ability to do page caching and page
fragement caching.  This means for commonly accessed dynamic pages that you
want to refresh for everybody once every N minutes, you can cache the
gzip'ed response, which leads to very high throughput.

Of course, none of this is directly MyFaces/JSF related.. so I'll shut up
now :)

Daniel.


-----Original Message-----
From: Daniel Young [mailto:dyoung@synyati.com.au] 
Sent: Thursday, 23 November 2006 3:46 PM
To: 'MyFaces Discussion'
Subject: RE: Very important JSF issue

Hi again Dominik,

If you have wget (command line tool on linux, I think it's available for
windows too), you can do this:

wget --header "accept-encoding: gzip" --save-headers
"http://your.site.here/"

Then if you open up the response back, it will have a Content-Encoding of
gzip and the contents will be binary/unintelligible.

If you don't have wget, you could use the LiveHttpHeaders add-on for
Firefox, or something similar that lets you inspect the Http Headers.  I
don't have that plugin anymore, so only tried with wget.

Hope that helps,
Daniel.


-----Original Message-----
From: Bieringer.Dominik.nf@gmx.net [mailto:Bieringer.Dominik.nf@gmx.net] 
Sent: Thursday, 23 November 2006 3:31 PM
To: 'MyFaces Discussion'
Subject: AW: Very important JSF issue

Hi Daniel,

CPU cycles are not really a concern, I think I've already added the
corresponding attribute vor gzip encoding in server.xml on tomcat, but I'm
not sure if it is used... 

Is there a way to check wheter gzip encoding is used or not? Is there a way
to see some stats... e.g.: the compression ratio, etc.?

Thx for the answer,
Dominik

-----Ursprüngliche Nachricht-----
Von: Daniel Young [mailto:dyoung@synyati.com.au] 
Gesendet: Mittwoch, 22. November 2006 23:48
An: 'MyFaces Discussion'
Betreff: RE: Very important JSF issue


Dominik,

As well as the upgrade to the nightly build, you should also consider
enabling GZIP-encoding on your web server for production deployment.  You
can either do this with apache/mod_gzip running out the front or by using a
GzipFilter in your web app.

If CPU cycles are a concern, then apache/mod_gzip on a separate load
balancing server may be the preferred option.

Daniel.

-----Original Message-----
From: Martin Marinschek [mailto:martin.marinschek@gmail.com] 
Sent: Thursday, 23 November 2006 8:02 AM
To: MyFaces Discussion
Subject: Re: Very important JSF issue

Upgrade to the latest nightly build - link sizes are much smaller there.

regards,

Martin

On 11/22/06, Bieringer, Dominik <DB...@thegoldensource.com> wrote:
>
>
>
>
> Hi all,
>
>
>
> I'm writing concerning two different problems:
>
>
>
> Using MyFaces links are generated like the one below: (The following code
is
> rendered for just ONE LINK!!)
>
>   <a href="#"
>
onclick="clear_mainBrowse_3AbrowseContent_3AbrowseListPage_3AbrowseListMain_
3AbrowseListResults_3AbrowseListResultsForm();document.forms['mainBrowse:bro
wseContent:browseListPage:browseListMain:browseListResults:browseListResults
Form'].elements['autoScroll'].value=getScrolling();document.forms['mainBrows
e:browseContent:browseListPage:browseListMain:browseListResults:browseListRe
sultsForm'].elements['mainBrowse:browseContent:browseListPage:browseListMain
:browseListResults:browseListResultsForm:_link_hidden_'].value='mainBrowse:b
rowseContent:browseListPage:browseListMain:browseListResults:browseListResul
tsForm:listResults:11:panelPckLink:_idJsp74';if(document.forms['mainBrowse:b
rowseContent:browseListPage:browseListMain:browseListResults:browseListResul
tsForm'].onsubmit){var
>
result=document.forms['mainBrowse:browseContent:browseListPage:browseListMai
n:browseListResults:browseListResultsForm'].onsubmit();
>  if( (typeof result == 'undefined') || result )
>
{document.forms['mainBrowse:browseContent:browseListPage:browseListMain:brow
seListResults:browseListResultsForm'].submit();}}else{document.forms['mainBr
owse:browseContent:browseListPage:browseListMain:browseListResults:browseLis
tResultsForm'].submit();}return
> false;"
>
id="mainBrowse:browseContent:browseListPage:browseListMain:browseListResults
:browseListResultsForm:listResults:11:panelPckLink:_idJsp74">[A]</a>
>
>
>
>
> . My page has several links on it (It's a dataTable with 50 rows and
having
> 4 links each row.. My page has a size of about 500KB !!!). What can I do
> about that? That's horrible. just imagine page loading times for clients,
> having slow internet connections. think about server traffic !?
>
>
>
> Is there a way to avoid this 'mega links'? Maybe it's possible to tell JSF
> to generate aliases for the long component identifiers? It would be really
> nice if someone can help me with that.
>
>
>
>
>
> Thanks in advance,
>
> Dominik


-- 

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces


AW: GZipping (was: Very important JSF issue)

Posted by Bi...@gmx.net.
Thx very much.. I've to try that today.

Dominik

-----Ursprüngliche Nachricht-----
Von: Daniel Young [mailto:dyoung@synyati.com.au] 
Gesendet: Donnerstag, 23. November 2006 06:56
An: 'MyFaces Discussion'
Betreff: GZipping (was: Very important JSF issue)


Sorry, me again-   as far as stats go, you could use wget and just check the
resulting file size.

If you are interested in more control, and in caching gzipped responses in
your server, see ehcache:
http://ehcache.sourceforge.net/EhcacheUserGuide.html

It contains a GzipFilter and the ability to do page caching and page
fragement caching.  This means for commonly accessed dynamic pages that you
want to refresh for everybody once every N minutes, you can cache the
gzip'ed response, which leads to very high throughput.

Of course, none of this is directly MyFaces/JSF related.. so I'll shut up
now :)

Daniel.


-----Original Message-----
From: Daniel Young [mailto:dyoung@synyati.com.au] 
Sent: Thursday, 23 November 2006 3:46 PM
To: 'MyFaces Discussion'
Subject: RE: Very important JSF issue

Hi again Dominik,

If you have wget (command line tool on linux, I think it's available for
windows too), you can do this:

wget --header "accept-encoding: gzip" --save-headers
"http://your.site.here/"

Then if you open up the response back, it will have a Content-Encoding of
gzip and the contents will be binary/unintelligible.

If you don't have wget, you could use the LiveHttpHeaders add-on for
Firefox, or something similar that lets you inspect the Http Headers.  I
don't have that plugin anymore, so only tried with wget.

Hope that helps,
Daniel.


-----Original Message-----
From: Bieringer.Dominik.nf@gmx.net [mailto:Bieringer.Dominik.nf@gmx.net] 
Sent: Thursday, 23 November 2006 3:31 PM
To: 'MyFaces Discussion'
Subject: AW: Very important JSF issue

Hi Daniel,

CPU cycles are not really a concern, I think I've already added the
corresponding attribute vor gzip encoding in server.xml on tomcat, but I'm
not sure if it is used... 

Is there a way to check wheter gzip encoding is used or not? Is there a way
to see some stats... e.g.: the compression ratio, etc.?

Thx for the answer,
Dominik

-----Ursprüngliche Nachricht-----
Von: Daniel Young [mailto:dyoung@synyati.com.au] 
Gesendet: Mittwoch, 22. November 2006 23:48
An: 'MyFaces Discussion'
Betreff: RE: Very important JSF issue


Dominik,

As well as the upgrade to the nightly build, you should also consider
enabling GZIP-encoding on your web server for production deployment.  You
can either do this with apache/mod_gzip running out the front or by using a
GzipFilter in your web app.

If CPU cycles are a concern, then apache/mod_gzip on a separate load
balancing server may be the preferred option.

Daniel.

-----Original Message-----
From: Martin Marinschek [mailto:martin.marinschek@gmail.com] 
Sent: Thursday, 23 November 2006 8:02 AM
To: MyFaces Discussion
Subject: Re: Very important JSF issue

Upgrade to the latest nightly build - link sizes are much smaller there.

regards,

Martin

On 11/22/06, Bieringer, Dominik <DB...@thegoldensource.com> wrote:
>
>
>
>
> Hi all,
>
>
>
> I'm writing concerning two different problems:
>
>
>
> Using MyFaces links are generated like the one below: (The following code
is
> rendered for just ONE LINK!!)
>
>   <a href="#"
>
onclick="clear_mainBrowse_3AbrowseContent_3AbrowseListPage_3AbrowseListMain_
3AbrowseListResults_3AbrowseListResultsForm();document.forms['mainBrowse:bro
wseContent:browseListPage:browseListMain:browseListResults:browseListResults
Form'].elements['autoScroll'].value=getScrolling();document.forms['mainBrows
e:browseContent:browseListPage:browseListMain:browseListResults:browseListRe
sultsForm'].elements['mainBrowse:browseContent:browseListPage:browseListMain
:browseListResults:browseListResultsForm:_link_hidden_'].value='mainBrowse:b
rowseContent:browseListPage:browseListMain:browseListResults:browseListResul
tsForm:listResults:11:panelPckLink:_idJsp74';if(document.forms['mainBrowse:b
rowseContent:browseListPage:browseListMain:browseListResults:browseListResul
tsForm'].onsubmit){var
>
result=document.forms['mainBrowse:browseContent:browseListPage:browseListMai
n:browseListResults:browseListResultsForm'].onsubmit();
>  if( (typeof result == 'undefined') || result )
>
{document.forms['mainBrowse:browseContent:browseListPage:browseListMain:brow
seListResults:browseListResultsForm'].submit();}}else{document.forms['mainBr
owse:browseContent:browseListPage:browseListMain:browseListResults:browseLis
tResultsForm'].submit();}return
> false;"
>
id="mainBrowse:browseContent:browseListPage:browseListMain:browseListResults
:browseListResultsForm:listResults:11:panelPckLink:_idJsp74">[A]</a>
>
>
>
>
> . My page has several links on it (It's a dataTable with 50 rows and
having
> 4 links each row.. My page has a size of about 500KB !!!). What can I do
> about that? That's horrible. just imagine page loading times for clients,
> having slow internet connections. think about server traffic !?
>
>
>
> Is there a way to avoid this 'mega links'? Maybe it's possible to tell JSF
> to generate aliases for the long component identifiers? It would be really
> nice if someone can help me with that.
>
>
>
>
>
> Thanks in advance,
>
> Dominik


-- 

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces