The next improvement was to add gzip compression to reduce size of code we sent to the client. We introduced this in Zimbra 3.0, and the browsers of the time weren’t particularly fast at loading complex AJAX scripts, so we tried to reduce load time by reducing file size. We managed to reduce the size on the wire by about 75%. At the time we still downloaded our entire client code base at login/startup time. Zimbra continued to grow with new features, and we increased our development team.
This, however, cause a problem. Since JSMin was RegEX based, we would periodically hit issues where it would choke on a certain complex JS expressions. Worse yet, it would break the working code in ways that only appeared at run-time. This meant that it would be difficult for us to debug or reproduce issues until our users found them.
5.0 will also include our new ‘Lazy Loading‘ method to help further decrease startup/login tmes. Learning from Dojo’s package system, Conrad Damon and Andy Clark started a project on the client team to move to component based loading system. Basic idea is you group the code into small packages or modules, and create dependencies on each. So for startup you’d require the login package and the mail core package as an example.
With Lazy Loading, and YUI Compressor, we now have loading times 3 to 4 times faster with our AJAX client when compared to the latest ZCS 4.5.x release. Interestingly enough, Safari 3 seems to be the fastest of all of the browsers we’ve tested (well save the details of that test for a future blog post).
Written by Kevin Henrikson, published by jholder