The Critical Rendering Path is the sequence of tasks the browser performs to first render a page on the screen, i.e., download, process, and convert HTML, CSS, and JavaScript code into actual pixels and paint them on the screen.

The Critical Rendering Path Optimization is the process of minimizing the time spent by the browser to perform each step of the sequence prioritizing the display of content related to the current user action.

Much of this process pertains to the portion of the page that is visible without scrolling down the browser window. That section is also known as Above the Fold. For better usability, the ATF should be rendered as soon as possible, and this can be done by reducing the number of network round trips at a minimum. The resources required to render the ATF are considered critical, and optimizing the Above the Fold means minimizing the impact of critical resources on the first page render time.

In this post, we will walk through the Critical Rendering Path optimization sequence.

The Critical Rendering Path Sequence

Here is the sequence of steps performed by the browser to render a page:


As well explained in Google’s Critical Rendering Path Optimization guide, the browser builds the Document Object Model in a four-step sequence:

What is important to note here is that the browser constructs the DOM incrementally. This allows us to speed up the rendering of the page by creating efficient DOM structures.

DOM structure diagram

DOM structure


When the parser encounters a link tag that refers to an external CSS stylesheet, it blocks the parsing and sends out a request for this resource. Once the CSS file has been received, the browser starts building a tree data structure of CSS nodes.

Unlike DOM construction, CSSOM construction is not incremental. The browser can’t use a portion of a stylesheet because styles can be refined and redeclared in the same stylesheet. For this reason, the browser blocks the rendering process until it receives and parses all the CSS. This means that CSS is render-blocking.

CSSOM structure diagram

CSSOM structure.

The Render Tree

The browser combines DOM and CSSOM into the Render Tree, the final tree structure containing all nodes and properties used to render the page to the screen.

The Render Tree only contains nodes that are required to render a page. As a consequence, invisible nodes are omitted.

The browser uses the Render Tree to calculate node dimensions and position as an input for the painting process.

Render Tree structure diagram

Render Tree structure.

Layout and Paint

In the layout stage, the browser calculates the dimensions and position of each node of the Render Tree. The browser traverses the Render Tree starting from its root and produces a box model in this stage. This information is finally used to convert each node of the Render Tree into actual pixels on the screen.

Critical Rendering Path Optimization

The time required to run the entire process can be variable. It depends on the document size, the number of requests, the applied styles, the user device, etc.
One of the most relevant Google recommendations is to prioritize visible content to render the Above the Fold as quick as possible, and provides two main rules to follow:

As well explained in Google’s PageSpeed guide, if the amount of data required to render the ATF exceeds the initial congestion window (14.6kb), additional network round trips between the server and browser will be required. On mobile networks, with high latencies, this would significantly delay the page loading (read more on latency).
The browser builds the DOM incrementally, allowing us to reduce the time required to render the ATF by structuring the HTML to load the above-the-fold first and defer the rest of the page.

Examples of above the Fold content on mobile, tablet and desktop devices

The Above the Fold content varies depending on the user device

But optimization does not end with the construction of an effective DOM structure. Rather, it’s a process of improvement and measurement that involves the whole Critical Rendering Path sequence.

Let’s dive deep.

Minimize Resource Dimensions

We can reduce the amount of data the browser is going to download by minifying, compressing, and caching HTML, CSS, and JavaScript resources:

Optimize CSS

Now we know that the browser has to wait until it fetches and processes the CSS code before rendering the page (CSS is render-blocking). But not all CSS resources are render-blocking.

CSS can be scoped to particular conditions, and we can optimize it using media types and media queries. If you’re viewing a webpage on the screen, the browser will send a request for print media type, but it won’t block the rendering of the page for this resource.
Take the following link tag:

<link rel="stylesheet" href="style.css" />

The referenced stylesheet of this tag applies under any condition, independently from the current media type, screen resolution, device orientation, etc. This means that the CSS resource is always render-blocking.

Luckily, we can send a request for a CSS resource under specific conditions. We could move print styles into a separate file and use the media attribute to tell the browser that the specified style sheet should only be loaded when printing the page, and it doesn’t need to block the rendering on the screen:

<link rel="stylesheet" href="print.css" media="print" />

The browser still downloads the print.css stylesheet, but it won’t block the rendering. Moreover, the browser has to download less data for the main CSS file, which would help us speed up the download. We can specify any media query on the link attribute, so we can split the CSS into multiple files and load them conditionally:

<link rel="stylesheet" href="style.css" media="screen" />
<link rel="stylesheet" href="portrait.css" media="orientation:portrait" />
<link rel="stylesheet" href="widescreen.css" media="(min-width: 42rem)" />

Be sure your styles are actually required to render the page. You can add an appropriate value to the media tag attribute and unblock rendering if they’re not.

Media types and queries can help us speed up the page rendering, but we can do a lot more.

Speed-up Layout and Paint Processes

The time spent by the browser to layout the document depends on the number of DOM elements to layout and the complexity of those layouts.

Computing element size and position takes time and reduces performance. Making the DOM as simple as possible and avoiding using JavaScript to anticipate the layout process would help the browser speed up the page rendering (read more on layout optimization).

Strictly connected to the Layout is the Paint process, which is probably the most time-consuming stage in the Critical Rendering Path sequence. Anytime you change the layout of an element or any non-geometric property, the browser triggers a paint event. Making things as simple as possible at this stage could help the browser speed up the painting process. For instance, a box-shadow property, which requires calculations, would take longer to paint than a solid border color.

Chrome DevTools allow to identify the portions of the page that are being painted

Chrome DevTools allow identifying portions of the page being painted.

Optimizing the page painting process may not be that easy, and you should make use of your browser’s developer tools to measure how long the browser takes to trigger each paint event. You can read more on this topic in Google’s Rendering Performance guide.

Make JavaScript unblocking

When the browser encounters a script tag, it has to stop parsing the HTML code. Inline scripts are executed at the exact point in the document and block the DOM construction until the JS engine finishes running. In other words, inline JavaScript can significantly delay the initial render of the page. But JavaScript also allows to manipulate CSS properties, so the browser has to pause the script execution until it has finished downloading and building the CSSOM. This means that JavaScript is parser blocking.

In the case of external JS files, the parser must also wait until the resource has been fetched from cache or remote server, and this could heavily slow down the time to first page render.
That being said, what can we do to minimize the time spent by the browser to load and execute JavaScript?

Wrapping Up Optimization Rules

That’s a lot of stuff, isn’t it? Let’s take a breath, and write down a list of the optimization actions described so far.

Now that we know the basic concepts of Critical Rendering Path Optimization, we can look at some WordPress popular optimization plugins.

Optimizing the Critical Rendering Path in WordPress

WordPress users can take advantage of several plugins that cover almost every aspect of the optimization process. You can install a fully-featured plugin or install several plugins at once, each providing specific optimization features.

If your site is hosted by Kinsta you won’t need a caching plugin because No WordPress Caching Plugins Needed at Kinsta.

W3 Total Cache

This single plugin covers almost every stage of the Critical Rendering Path optimization process. At first glance, the plugin configuration can be overwhelming. Still, once you become more familiar with the Critical Rendering Path sequence, you will be able to take advantage of a powerful performance toolset.

W3 Total Cache WordPress plugin

W3 Total Cache WordPress plugin

Here is a list of some plugin features:

These are just a few of the many W3TC features. In this detailed guide, you can read more about all the plugin’s features, settings, and options.

W3 Total Cache JavaScript minify settings

W3 Total Cache JavaScript minify settings

WP Super Cache

WP Super Cache is another popular plugin for site performance.

Struggling with downtime and WordPress problems? Kinsta is the hosting solution designed to save you time! Check out our features
WP Super Cache WordPress plugin

WP Super Cache WordPress plugin

It comes with many optimization features, but it’s less comprehensive than the previous W3 Total Cache and may look more affordable to novice and intermediate users.

WordPress Super Cache tester

WordPress Super Cache tester

Basically, it provides caching features and HTTP compression, but lacks resource minification and JavaScript optimization with async and defer attributes. However, more than one million active installs prove that the plugin is worth a try.

GZIP option in WP Super Cache

GZIP option in WP Super Cache


With over 1,000,000 active installs, Autoptimize is one of the most popular free plugins for minification.

Autoptimize WordPress plugin

Autoptimize WordPress plugin

It comes with an options page divided into several sections where the site admin can separately configure HTML, CSS, and JavaScript minification.

Autoptimize HTML optimization option in Autoptimize settings

Autoptimize HTML optimization option

You can also aggregate independent scripts or stylesheets and set exceptions for specific resources. Furthermore, Autoptimize allows to cache minified resources on disk or CDN and save optimized assets as static files. For finding the best settings for your WordPress site, you can follow our detailed Autoptimize guide here.

Above the Fold Optimization

This plugin provides a comprehensive toolset for Above the Fold optimization. It’s a tool for professionals and advanced users to score 100/100 on the Google PageSpeed test.

Above the Fold Optimization WordPress plugin

Above the Fold Optimization WordPress plugin

Here are some of the most interesting features:

Critical CSS tools:

CSS load optimization:

JS load optimization:

Moreover, the plugin provides support for Google’s Progressive Web App and Google Web Font optimization. Other optimization plugins you may want to try:

Swift Performance

Swift Performance is another plugin you might want to check out. This premium plugin can help increase your performance scores and was developed specifically to help you try and achieve those 100/100 Google PageSpeed Insights scores.

Swift Performance WordPress plugin

Swift Performance WordPress plugin

Some of its main features include:

You’ll find a deeper view of WordPress optimization plugins in How to Eliminate Render-Blocking JavaScript and CSS.


The Critical Rendering Path Optimization is a process of improvement and measurement that requires a clear understanding of every task the browser performs to convert code into pixels and render a page on the screen. You can learn more about Critical Rendering Path in Google’s optimization guide.

Here on Kinsta Blog, we try to cover any aspect of performance optimization. Here is a list of further readings:

How long does it take you to optimize the Critical Rendering Path of your websites? And which aspects of the optimization process are the toughest for you to master? Let us know in the comments below.

Save time, costs and maximize site performance with:

  • Instant help from WordPress hosting experts, 24/7.
  • Cloudflare Enterprise integration.
  • Global audience reach with 28 data centers worldwide.
  • Optimization with our built-in Application Performance Monitoring.

All of that and much more, in one plan with no long-term contracts, assisted migrations, and a 30-day-money-back-guarantee. Check out our plans or talk to sales to find the plan that’s right for you.