First Input Delay (FID) measures the delay between a user's first interaction (like clicking a button or tapping a link) and the browser's response. This metric was replaced by Interaction to Next Paint (INP) as a Core Web Vital in March 2024.
Why FID matters
When users click something on your page and nothing happens, they get frustrated. FID captures this experience by measuring how responsive your page is to user input.
FID thresholds
- Good: 100 milliseconds or less
- Needs Improvement: Between 100 and 300 milliseconds
- Poor: More than 300 milliseconds
Common causes of poor FID
- Long JavaScript execution tasks
- Large JavaScript bundles
- Third-party scripts blocking the main thread
- Heavy JavaScript frameworks
Improving FID
- Break up long tasks into smaller chunks
- Reduce JavaScript execution time
- Minimize third-party code impact
- Use a web worker for non-UI work
Related Terms
Core Web Vitals
A set of three metrics defined by Google that measure the loading performance, interactivity, and visual stability of a web page.
Interaction to Next Paint (INP)
A Core Web Vital that assesses page responsiveness by measuring the latency of all user interactions throughout the page lifecycle.
JavaScript Execution Time
The time the browser spends parsing, compiling, and executing JavaScript code, which can block the main thread and delay interactivity.
Total Blocking Time (TBT)
A lab metric that measures the total amount of time the main thread was blocked long enough to prevent input responsiveness.