users@woodstock.java.net

Re: Web resource file downloads and performance

From: Dan Labrecque <Dan.Labrecque_at_Sun.COM>
Date: Thu, 13 Dec 2007 14:33:30 -0500

Jason Suplizio wrote:
> Hi, we just did some basic benchmarking and measured roughly about
> 700k of CSS and scripts download for a relatively basic page.
>
> Is there a way to control and limit what's being sent as far as
> scripts and css somehow? We've tried using the 'webuiJsfx' attribute:
>
> <webuijsf:head webuiJsfx="false" title="...">
>

Setting webuiJsxf=false will reduce the overall download, but it
disables Ajax features. It will also prevent the JSF Extensions script
from being included in the page. Setting webuiAll=false will also help
reduce the footprint as well (i.e., if you use only the common widgets)
-- I believe the default is false.

> Without the 'webuiJsfx' attribute we found:
>
> 603kb transfer, ~3.96s over 5 loads with cache turned off.
> 749kb (688 from cache), ~5.0s over 5 loads with cache turned on.
>
> With the 'webuiJsfx' attribute we found:
> 565kb transfer. ~4.0s over 5 loads with cache turned off.
> 710kb (650 from cache). ~5.5s over 5 loads with cache turned off.

How are you testing the cache? If you click the browser's reload button,
that forces all resources to be verified. Although you may have a cache,
the browser still submits individual requests to ensure each resource is
valid. Instead, place your cursor in the location bar and press return.

BTW, if you want to ensure resources are cached, you'll need to use an
HTTP monitor like Netbeans. Don't rely on Firebug to show the true
number of requests. Although, Firebug can be useful to show the number
of KB obtained locally.

>
> This could be a show-stopper for our external applications that need
> to go via SSL ( i.e. without caching). What can we do to further
> reduce this file-size footprint?

We can probably tweak some things; for example, I've been meaning to
look at the "Dean Edward's packer tool". Apparently, this compresses
JavaScript files more than half the size of Dojo's Shrink Safe approach.
The CSS file and theme are both 130 KB, so that's another area we can
look at. If you have created your own custom theme, you might look at
compressing that, too.

Dan