--- url: "https://web.dev/learn/performance/understanding-the-critical-path" titulek: "Understand the critical path | web.dev" h1: "Understand the critical path Stay organized with collections Save and categorize content based on your preferences." popis: "The critical rendering path is a concept in web performance that deals with how quickly the initial rendering of a page appears in the browser. This module goes into the theory behind the critical rendering path, covering concepts such as render-blocking and parser-blocking resources, and how they play a key role in how quickly a page appears in the browser." jazyk: "en" kanonicka: "https://web.dev/learn/performance/understanding-the-critical-path" drobecky: ["web.dev", "Resources", "Performance"] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-14 00:54:38" znaku: 15701 slov: 2345 kodovani: "iso-8859-2" sha256: "0d3f2e8636b7d64839ce9f214e1cc9d1dc18f56fa7e66f3351dd374e42899bc1" --- Understand the critical path Stay organized with collections Save and categorize content based on your preferences. The critical rendering path refers to the steps involved until the web page starts rendering in the browser. To render pages, browsers need the HTML document itself as well as all the critical resources necessary for rendering that document. Getting the HTML document to the browser was covered by the previous [General HTML performance considerations module](/learn/performance/general-html-performance). In this module, however, we'll look more at what the browser does *after* it downloads the HTML document in order to render the page. Progressive rendering The web is distributed by nature. Unlike native applications that are installed before use, browsers cannot depend on websites having all the resources necessary to render the page. Therefore, browsers are very good at rendering pages progressively. Native apps typically have an install phase, and then a running phase. However, for web pages and web apps, the lines between these two phases are much less distinct, and browsers have been specifically designed with that in mind. Once the browser has resources to render a page, it will typically begin to do so. The choice therefore becomes about *when* to render: when is too early? If the browser renders as soon as possible when it just has some HTMLâbut before it has any CSS or necessary JavaScriptâthen the page will momentarily look broken and change considerably for the final render. This is a worse experience than initially presenting a blank screen for a time until the browser has more of these resources needed for an initial render that offers a better user experience. On the other hand, if the browser waits for *all* resources to be available instead of doing any sequential rendering, then the user will be left waiting for a long time; often unnecessarily so if the page was usable at a much earlier point in time. The browser needs to know what the minimum number of resources it should wait for in order to avoid presenting an obviously broken experience. On the other hand, the browser also shouldn't wait longer than necessary before presenting the user with some content. The sequence of steps the browser takes before performing that initial render is known as the *critical rendering path*. Understanding the critical rendering path can help improve web performance by ensuring you don't block initial page rendering any more than necessary. At the same time, however, it's important to also not allow rendering to happen too early by removing the necessary resources for that initial render from the critical rendering path. The (critical) rendering path The rendering path involves the following steps: Constructing the Document Object Model (DOM) from the HTML. Constructing the CSS Object Model (CSSOM) from the CSS. Applying any JavaScript that alters the DOM or CSSOM. Constructing the render tree from the DOM and CSSOM. Perform style and layout operations on the page to see what elements fit where. Paint the pixels of the elements in memory. Composite the pixels if any of them overlap. Physically draw all the resulting pixels to screen. The rendering process, as detailed in the previous list. Only after all these steps have been completed, will the user see content on the screen. This rendering process happens multiple times. The initial render invokes this process, but as more resources that affect the page's rendering become available, the browser will re-run this processâor maybe just parts of itâto update what the user sees. The critical rendering path focuses on the process previously outlined for the initial render, and depends on the critical resources necessary for it. What resources are on the critical rendering path? The browser needs to wait for some critical resources to download before it can complete the initial render. These resources include: Part of the HTML. Render-blocking CSS in the `
` element. Render-blocking JavaScript in the `` element. A key point is that the browser processes HTML in a streaming fashion. As soon as the browser gets any portion of a page's HTML, the browser starts processing it. The browser can thenâand often doesâdecide to render it well before receiving the rest of a page's HTML. Importantly, for the initial render, the browser will *not* typically wait for: All of the HTML. Fonts. Images. Non-render-blocking JavaScript outside of the `` element (for example, `