Track 02 · Lesson 13 of 17Inside the browser
- 01Events and bubbling
- 02What fires when you click or type
- 03Keyboard, input and focus events
- 04Default actions and preventDefault()
- 05Event delegation
- 06Listener options and cleanup
- 07Custom events
- 08Debounce and throttle
- 09Events in React
- 10The event loop
- 11Don't block the main thread
- 12The rendering pipeline
- 13Core Web Vitals
- 14HTTP caching
- 15Responsive design
- 16SEO basics
- 17Service workers and offline
Core Web Vitals
Lesson 13 of 17· 7 min
Google measures real users' experience with three numbers. They affect search ranking, but more importantly they track whether the page feels fast and stable. Try the layout shift demo: press Reload, then quickly try to click "Continue reading".
The three numbers#
- LCP, Largest Contentful Paint: how long until the biggest thing on screen, usually a hero image or headline, appears. Good is 2.5 seconds or less.
- INP, Interaction to Next Paint: how long the page takes to visibly respond after a click, tap or key press. Good is 200 ms or less. Long tasks on the main thread are the usual culprit.
- CLS, Cumulative Layout Shift: how much content jumps around while you're using it. Good is 0.1 or less.
How to fix each one#
- LCP: compress and preload the hero image, serve it from a CDN, and don't make the page wait for scripts before it can show anything.
- INP: keep event handlers short, and break up or move heavy work, as in the main-thread lesson.
- CLS: give images, videos, ads and embeds a width and height or an
aspect-ratio, and never insert content above what someone is reading.
Check yourself