The rendering path and Core Web Vitals
What the browser must do before it paints, and how to make it faster.
To show a page the browser downloads the HTML, builds the DOM, downloads and parses CSS into the CSSOM, combines them into a render tree, computes layout, then paints. This is the critical rendering path.
- CSS is render-blocking: the page is not painted until the CSS in the head is ready. Keep it small and inline only the critical part if needed.
- A normal
<script>is parser-blocking. Usedefer(runs after parsing, in order) ortype="module", orasyncfor independent scripts. - Images and fonts do not block the first paint but affect LCP and layout shifts.
Core Web Vitals
| Metric | Measures | Good |
|---|---|---|
| LCP Largest Contentful Paint | When the main content appears | Under 2.5 s |
| INP Interaction to Next Paint | How quickly the page reacts to taps and clicks | Under 200 ms |
| CLS Cumulative Layout Shift | Unexpected movement of content | Under 0.1 |
What usually helps
- Serve static files from a CDN with long cache lifetimes and compression (Brotli or gzip).
- Preload the LCP image or font, and never lazy-load it.
- Reserve space for images, ads and embeds (
width,height,aspect-ratio,min-height). - Ship less JavaScript. Split bundles and remove unused code.
- Test on a mid-range phone and a slow connection, not on your fast laptop.
CarefulLab scores from Lighthouse are a guide. Real users decide: check field data (the Chrome UX Report in Search Console or PageSpeed Insights) for the real picture.
Test yourself
Answer all the questions, then check them. Finish with every answer right to mark the lesson as done.