Critical Rendering Path — Cheat Sheet

FE Lead prep · ref 02

The pipeline

DOMparse HTML
CSSOMparse CSS
Render Treevisible nodes
Layoutgeometry / reflow
Paintrasterize
CompositeGPU layers

What blocks the path (the whole interview)

ResourceBlocksWhyFix
CSSrendering (render tree)rules cascade → can't paint till CSSOM completeinline critical CSS, load rest non-blocking
Sync JSthe parser (DOM)can mutate DOM; also waits on pending CSS (may read styles)defer / async, code-split

async vs defer

asyncdefer
downloadparallelparallel
executesASAP on arrivalafter parse, pre-DCL
order keptNOYES
use forindependent tagsapp / ordered code

Optimize = shorten to 1st paint

Lead one-liner (memorize)

Say first  “Two things stall the page: CSS blocks painting, JS blocks parsing. So two fixes: ship less critical CSS, and get JS off the parser with defer/async.”

Sources: web.dev — critical path · MDN — CRP · MDN — <script> · web.dev — render tree

Don't fail the interview

1. CSS blocks rendering, not DOM construction — DOM & CSSOM build in parallel.
2. A sync script also waits for CSS — it may call getComputedStyle.
3. async = no order guarantee → only for independent scripts. Ordered code → defer.
4. Animate transform/opacity (composite), never width/top (reflow).