The critical rendering path is everything the browser must do between receiving HTML bytes and painting pixels: parse HTML into the DOM, parse CSS into the CSSOM, combine them for style, compute layout, then paint and composite. CSS is render-blocking: the browser won't paint until the stylesheets in <head> have loaded. Classic <script> is parser-blocking: HTML parsing stops while it downloads and runs, and it also waits for preceding CSS. To shorten the path, reduce and inline critical CSS, defer or async scripts, make key resources discoverable early, and send less HTML before the first meaningful content.
<img>, <link> and <script src> URLs even while the main parser is blocked. Resources it can't see (injected by JS, CSS backgrounds, @import inside CSS) are discovered late.| Resource | Blocks parsing? | Blocks rendering? |
|---|---|---|
<link rel="stylesheet"> in <head> | No | Yes, until loaded (unless media doesn't match) |
<script> (classic, no attributes) | Yes, download + execute, and waits for pending CSS | Indirectly |
<script defer> | No; runs after parsing, in order | No |
<script async> | No to download; pauses parsing briefly while it runs | No |
<script type="module"> | Deferred by default | No |
| Web fonts | No | Text may be invisible (depends on font-display) |
| Images | No | No (but often the LCP element) |
Why does a classic script wait for CSS? Because it might read computed styles (getComputedStyle), so the browser must finish the CSSOM first. A slow stylesheet therefore delays script execution, which delays parsing.
<head> for above-the-fold content, with the rest loaded non-blocking. Or simply keep total CSS small and split by route.media attributes for non-matching stylesheets (media="print") so they don't block rendering.defer for app scripts. Avoid document.write and synchronous third-party tags in <head>.<img> tags in server HTML, preload for fonts or CSS-referenced hero images, no @import chains.<head> early so the browser starts fetching CSS and JS while the server is still rendering the body.preconnect to unavoidable ones), and HTTP caching for repeat visits.async, then hitting ordering bugs. defer preserves order; async doesn't.Spotted a mistake or a rights concern? Report an issue