Home
← All questions

What is the Critical Rendering Path? | Web Fundamentals

MediumPremiumWeb Fundamentals

Web Fundamentals interview practice: Explain the steps the browser takes to render a page and how to optimize them.

Answer

The Critical Rendering Path (CRP) is the sequence of steps the browser performs to turn HTML/CSS/JS into pixels:

  1. HTML → DOM (parse markup into the DOM tree).
  2. CSS → CSSOM (parse styles into the CSSOM tree). CSS is render-blocking.
  3. DOM + CSSOM → Render Tree (only visible nodes with computed styles).
  4. Layout (reflow) — compute geometry/positions.
  5. Paint — fill pixels.
  6. Composite — layer the painted parts to screen.

JavaScript can block parsing (synchronous <script> blocks DOM construction and waits for CSSOM).

Optimizations:

  • Inline critical CSS; defer non-critical CSS (media, preload).
  • defer/async on scripts; move scripts to the end.
  • Minimize and compress resources; reduce the number of render-blocking requests.
  • Reduce DOM depth; avoid large reflows.
Premium question

Unlock the full model answer with Mentoxis Premium.

Unlock with Premium