Client bundle increase script size by 300kb!

104 views
Skip to first unread message

Kroc

unread,
Jul 4, 2012, 11:59:05 AM7/4/12
to google-we...@googlegroups.com
Hello,
Im using ClientBundle with a lot of picture (around 2000 picture divided into 36 bundles).
I've disabled data inlining with such option: <set-property name="ClientBundle.enableInlining" value="false" /> 

But the resulting script increase from 500kb (without bundle) to 800kb (with bundle)
It include such generated lines:
function lHb(){lHb=m3d;SEb();cEb=new Rxd((wyd(),new syd(nDb)),1140,0,228,120)}
function YOb(){YOb=m3d;DMb();PLb=new Rxd((wyd(),new syd($Kb)),1140,0,228,120)}
function u2b(){u2b=m3d;__b();l_b=new Rxd((wyd(),new syd(w$b)),1140,0,228,120)}
function I2b(){I2b=m3d;__b();z_b=new Rxd((wyd(),new syd(w$b)),3810,60,114,60)}
function G2b(){G2b=m3d;__b();x_b=new Rxd((wyd(),new syd(w$b)),3924,60,114,60)}

I understand the reason for this code to be generated, but it is a waste of space in my specific case:
All bundles are almost identic (only color variation) then all images cliping information are unnecessarily repreated.

Does anyone facing the same issue ?
Any idea to get rid of theses 300kb ?

Joseph Lust

unread,
Jul 5, 2012, 1:42:45 PM7/5/12
to google-we...@googlegroups.com
Kroc,

This is how ClientBundle is intended to work. I bet that loading 300KB is faster than loading 2000 separate images (~200 packets vs ~4000, assuming 1514B MTU).

Consider using code splitting to break out your image resources into separate bundles so that they are loaded as needed by different modules. That way you won't need that 300KB download up front.

See this recent post about how to cut down on initial download side.



Sincerely,
Joseph

Kroc

unread,
Jul 10, 2012, 8:20:09 AM7/10/12
to google-we...@googlegroups.com
yeah, code spliting is probably the solution...
I was hopping a way to apply clipping information on any image. Probably a bad idea ;)
Reply all
Reply to author
Forward
0 new messages