DOMContentLoaded / load (event) how to increase speed.

I am trying to do my best to increase the loading speed of my pages and, in particular, the loaded ajax components.

In firebug, my out put looks like this:

I'm not quite sure if I am reading this correctly, but it is either + 2.19 for DOMContentLoaded (or it could be 0.8 if we have to subtract this from the pending response).

But then 4.67s for the “load” (event).

Both of them seem to be significantly longer loading times.

I could not understand what could cause such times. This statistic is related to loading a direct html page, which I usually load through ajax. But this is just HTML. There is no javascript on the page, and the page loads directly, and not through an ajax request.

However, when I load this page via ajax, I detect a significant delay when the page tries to load.

Any suggestions?

I was browsing html in IE debugbar and it all looks amazingly clean. The page has 30 images. Could it be that the "load" event is waiting? And if so, is there a way to speed it up?

In particular, since the user will never load this page directly, but only through an ajax request, this is their way to improve page loading performance in ajax. The problem is not loading the ajax script, but in particular with the html page.

---------------------- Editted ------------------------ --- --- The results of the page are loaded into a jquery loop in which several images are visible at a time, so using lazyloader provides a pretty awful user interface. (assuming these are the images causing this problem).

+4
source share
1 answer

This firebug data tells you that:

  • It takes 2.1 seconds from the moment the request for the server code is launched to start the response.
  • It takes 19 ms to download a response (i.e. HTML)
  • 71 ms after that, the DOMContentLoaded event fires
  • After the page is fully loaded (after loading all the images), a loading event occurs.

DOMContentLoaded fires as soon as the DOM is ready. A load event waits until the entire page loads (including any external resources such as images)

Most of the time in your request (other than loading images) is spent on the server creating the HTML. Maybe your server code can be optimized to work faster?

+6
source

All Articles