1

I want to know the event with the earliest fired timing.

I think the most fastest event is DOMContentLoaded.

enter image description here

boxer bb
  • 55
  • 6

1 Answers1

1

Yes. Time to First Byte. Time to First Byte is the time for the very first HTTP response from the HTTP server to be received by the browser.

Time to First Byte (TTFB) is a foundational metric for measuring connection setup time and web server responsiveness in both the lab and the field. It helps identify when a web server is too slow to respond to requests. In the case of navigation requests—that is, requests for an HTML document—it precedes every other meaningful loading performance metric.

See this answer regarding measuring Time to First Byte to help measure TTFB.

Compare this to DOMContentLoaded:

The DOMContentLoaded event fires when the initial HTML document has been completely loaded and parsed, without waiting for stylesheets, images, and subframes to finish loading.

There are many other events including First contentful paint, Largest contentful paint, First input delay, Time to Interactive, Total blocking time and Cumulative layout shift

mikemaccana
  • 110,530
  • 99
  • 389
  • 494
  • Thank you for useful information, I didn't know the event. Can it be set in the argument of addEventListener? How to set an event handler using the TTFB event? – boxer bb Feb 16 '22 at 14:33
  • I understood there is not TTFB event on MDN reference, so it can't be set in the argument of addEventListener. https://developer.mozilla.org/en-US/docs/Web/Events#event_listing – boxer bb Feb 16 '22 at 22:17