What is the critical rendering path and how do you optimise it?
The critical rendering path is the sequence the browser follows to turn HTML, CSS and JavaScript into pixels: parse HTML into the DOM, parse CSS into the CSSOM, combine them into the render tree, then layout and paint. CSS is render-blocking because the browser cannot build the render tree without the CSSOM, so a stylesheet in the head delays first paint. Synchronous scripts block HTML parsing, and any script that reads or writes layout can force a costly reflow.
Optimising means minimising the number of critical resources and their bytes: inline critical above-the-fold CSS, defer non-critical CSS, load scripts with defer or async, and avoid chained request waterfalls.
Techniques include preloading key resources, preconnect to required origins, removing unused CSS, and keeping the DOM small. content-visibility: auto lets the browser skip rendering off-screen content. The Performance panel flame chart confirms whether a delay comes from CSS, JavaScript execution or resource loading.