Tuesday, February 14, 2006

Make the pages small for faster loading.

Huge thanks to baggeroli from http://www.hedir.com who spends so much time and energy in helping me to make Internet Polyglot a nice place for internet users to be.

This time he sent me some scaring numbers: my home page was weighting 165K!!! No surprise it was loading too long. The most of this load was javascript files totally unecessary for the home page. I removed some of those files, some of them I placed only on pages that need them (like wz_dragdrop.js or overlib.js) and the size of the page reduced to 40K. Besides, I put a "defer" directive to the javascript declaration so that some of js files are loaded only after the page is rendered.

It seems that now the page is loading much faster.

1 comment:

baggeroli said...

Technically speaking, the JS files don't load after the page is fully rendered with defer. It just give the browser a cue that it isn't necessary to load the JS files completely before the page is rendered.

To get the JS files to be loaded after the full page is rendered, you need an "onload".