I have a website, that is slow-ish. The server responds in around 2 - 300 ms at each request, but it takes 1.5 - 2 seconds for the page to be ready in the browser.
By experimenting with disabling javascript and CSS, I have determined that it is the browser's processing, that takes the majority of time.
Using Firebug, I see that the DOMContentLoaded event seems to fire after around 0.5 to 1 second after data is received from the server, and the "load" event fires after another half second.
Using Firebug's profiler, I see that javascript execution takes around 250 ms.
So, my questions are:
- What does the browser do in the remaining time, when Javascript execution takes 250 ms, but it takes a second before the page is ready ?
- What happens between DOMContentLoaded and load events
- What would be the best approach for me to performance-optimize the client side of such a page ?