First Input Delay (FID)
You'll learn what the legacy First Input Delay metric measured and how server-side rendering influences the responsiveness of user interactions.
A Legacy Metric: FID to INP
Important context: On March 12, 2024, Google officially replaced First Input Delay (FID) with Interaction to Next Paint (INP) as a Core Web Vital, and FID is now deprecated. You will learn about INP in the course's dedicated INP lessons for the current performance metric standards. However, understanding FID remains historically valuable, particularly for grasping how JavaScript execution impacts early page interactivity.
What did First Input Delay measure?
First Input Delay (FID) measured the time between when a user first interacted with your page (clicking a button, tapping a link, or entering text) and when the browser could actually begin processing event handlers in response to that interaction. It wasn't about visual rendering—it was purely about interactive responsiveness.
Think of it like calling a busy restaurant: the phone rings (your click), but the staff is too overwhelmed to answer immediately. FID was the frustrating wait time before someone picked up the phone.
Why Input Delays Happen
When JavaScript is executing on the browser's main thread, the browser cannot process user input. Even though content is completely visible on the screen, the browser might still be busy parsing and executing heavy JavaScript bundles. As a result, your click gets queued, waiting for the main thread to become available.
SSR's Impact on Interactivity
Server-side rendering (SSR) affects initial interactivity in two competing ways, which metrics like FID were designed to highlight:
Positive impact: SSR delivers functional HTML immediately, so the page appears interactive much faster. Basic native HTML links and forms can often work even before JavaScript fully loads.
Potential challenge: SSR applications still need to "hydrate"—the process of attaching JavaScript event handlers to the server-rendered HTML. During hydration, the main thread is busy, and user inputs get delayed. If a user tries to interact during this hydration phase, they experience a delay.
The historical lesson of FID remains true today: developers must optimize the hydration process and break up JavaScript execution into smaller chunks so the main thread remains responsive to user input.
Key Takeaway: First Input Delay (FID) is a deprecated legacy metric replaced by INP on March 12, 2024; however, it effectively illustrates how SSR hydration can block the main thread and cause frustrating input delays during JavaScript initialization.