1. DOM
- What happens
- HTML is parsed into tokens, nodes, then a tree. Scripts can change it as it's built
- Can start before all bytes arrive?
- Yes, parsing is incremental
The critical rendering path is the browser's sequence from HTML, CSS, and JavaScript to pixels. The five steps, what blocks them, how to shorten it, and a check.
The critical rendering path is the sequence of steps a browser takes to turn HTML, CSS and JavaScript into pixels: build the DOM and CSSOM, combine them into a render tree, run layout, then paint. CSS blocks rendering and synchronous scripts block HTML parsing, so those are where optimization starts.
Four quick questions, then a straight answer.
From your answers, this is quietly costing you traffic and nobody has the hours to chase it. Scaplet finds every affected page, drafts the fixes and tracks how AI answers mention you.
A data platform shipped 46 fixes without a ticket.
This looks handled. Re-check after a redesign, a migration or a big content push; that is when it breaks.
Your site is small and you have the time. Work through the steps on this page, starting with the pages that get the most traffic.
display: none elements and <head> are left outThis table follows MDN's critical rendering path guide. The steps run in a loop for interactive pages, which is why DOM and style changes after load can trigger layout again.
async where appropriate, or remove it<head>
<link rel="stylesheet" href="/app.css"> <!-- render-blocking CSS -->
<script src="/analytics.js" async></script> <!-- does not pause parsing -->
<script src="/app.js" defer></script> <!-- runs after parsing -->
</head>
<body>
<script src="/legacy.js"></script> <!-- synchronous: pauses parsing -->
</body>Defer or async non-essential scripts and remove what you don't need. MDN also suggests media queries to split CSS.
Minify CSS and JavaScript and drop unnecessary requests.
Make sure the assets needed for first render are fetched early. See preload.
More nodes mean longer style, layout and paint work.
On mobile, <meta name="viewport" content="width=device-width"> makes layout match the device width rather than a default of about 960px.
Run it on your own URL. Each stylesheet is a render-blocking request, and each script counted by the second line lacks async and defer. This is a rough count of the raw HTML: it won't see resources added by JavaScript, so confirm in the DevTools Performance panel or a Lighthouse run.
curl -sL -A 'Mozilla/5.0' https://web.dev/ > page.html
grep -o -i '<link[^>]*rel="stylesheet"[^>]*>' page.html | wc -l # stylesheets
grep -o -i '<script[^>]*>' page.html | grep -v -i -E 'async|defer|type="module"' | wc -l # synchronous scripts1 questions people ask next, answered from the sources on this page.
No. The critical rendering path is the process that gets pixels on screen. Largest Contentful Paint is a metric that measures when the largest content element appears. Shortening the path can improve it, but you verify by measuring.
The free audit reads robots.txt, sitemaps, status codes, canonicals, redirects and structured data.