Reference guide · performance · Published 2026-08-16 · 2 min read
DOMContentLoaded vs the load event in performance analysis
DOMContentLoaded versus load event timing, what each measures and how to read them in performance tools.
- ·Know the two events
- ·Read them in tools
- ·Optimise deliberately
DOMContentLoaded and the load event are two browser lifecycle moments that performance tools report, and they answer different questions. Confusing them leads to optimising the wrong thing.
Know the two events
- DOMContentLoaded (DCL). Fires on the
documentas soon as the HTML has been parsed and the DOM tree is built, before external images, stylesheets and scripts have necessarily finished loading. It marks when the document structure is ready to be read and manipulated. - The
loadevent. Fires onwindowonly after the entire page and all its subresources, including images, script files and stylesheets, have finished loading.
The difference is usually the page weight outside the initial HTML: images, iframes and other resources that keep the load event waiting long after the DOM is ready.
Read them in tools
- In DevTools. The Performance panel draws a blue vertical line for DOMContentLoaded and a red line for load. The gap between them shows how much work happens between "structure ready" and "everything loaded".
- In the Network panel. The same two indicators are marked, and "Finish" timing sits at or near load.
- What a large gap tells you. If DCL is fast but load is slow, the page is probably carrying many or heavy subresources (images, big scripts) that load late. That is normal for a media-heavy page, but can be trimmed.
Optimise deliberately
- Identify which matters for your goal. For interactive pages, making the DOM ready quickly (that is, a fast DCL) often matters more than a fast load. For fully static landing pages users perceive, the time until the
loadevent can be closer to what they experience. - Speed up DCL. Parse the HTML fast by keeping scripts from blocking parsing: use
deferorasyncon non-critical scripts (see HTML defer vs async), move scripts to the end or load them asynchronously, and inline only the critical CSS. - Speed up load. Images and iframes dominate the tail. Lazy-load below-fold media, size images explicitly (see image sizing), and avoid auto-playing large assets.
- Do not chase load for its own sake. A fast
loadevent on a page with heavy below-fold images may cost you by blocking useful earlier rendering. Modern pages often intentionally let theloadevent lag behind a performant first paint.