As a WooCommerce store owner, you don’t want customers to experience poor page load speeds and response times. This causes a poor user experience that leads to visitors bouncing off your website sooner than they had planned to, without seeing your product catalog.
Chaining critical requests can cause slower page load times and poor response times on your web page. All critical resources are being rendered in the same order that’s mentioned in your HTML code. As a result, it can delay the first content rendering on the visitor’s screen depending on the size of the resource and the length of the chain.
This guide will show you various ways to avoid chaining critical requests on your website.
Let’s start with the basics.
What is chaining critical requests?
Chaining critical requests is a sequence of requests depending on each other that are crucial for rendering content on your web page. The order in which critical requests are processed is determined by the critical rendering path.
It goes something like this:
It’s important to understand that all resources will be downloaded in the same order as they appear in the HTML code files. This means that you must specify critical resources so render-blocking resources don’t affect page load speeds or delay the critical rendering path.
How does chaining critical requests affect page speed?
The impact of chaining critical requests on your site will depend on the length of the chains and the size of each critical resource being rendered.
In simpler words, longer chains and larger resource sizes may mean slower page performance. This is because it will take a longer time for the browser to process and prepare each chain for displaying pixels on the page. As a result, it will take more time to first render content on your web page.
On the other hand, shorter chains and smaller resource sizes will make web pages load up faster and increase the responsiveness of your page elements. This way, it’s easier for the browser to quickly process and download all resources needed to render content on the page. On the front-end, this means site visitors will quickly be able to see content on the page when they first access your WooCommerce store.
What does the “avoid chaining critical requests” warning mean?
The “avoid chaining critical requests” warning simply means that critical resources needed to load the web page are overly large in size.
Additionally, this could also be an indicator if critical resources for your web page have latency. If the critical path latency is high, it may take more time to load the full chain, causing an even greater delay in the first rendering of content on your web page.
Chaining critical requests can affect page speed and other important page speed metrics that are needed for improving website ranking in Google’s search engine algorithms. Such metrics include the First Contentful Paint (FCP) or the Last Contentful Paint (LCP). Since longer chains delay the first loading of content on your web page, these metrics will be effected subsequently.
Other than slowing down the first rendering of content on the page, it also slows down the response on your page. As a result, it can cause a poor rating for your WordPress website in the PageSpeed Insights test and you’re likely to see the “avoid chaining critical requests” warning.
What causes the “avoid chaining critical requests” warning?
An easy way to know if critical requests are slowing down page speeds on your site is by using the PageSpeed Insights test.
Just enter the URL of your web page into the PageSpeed Insights test and it will display all the critical requests chains for resources that are loaded with a high priority. This will show you all the critical resources that are loaded in the critical rendering path. In addition to this, it will also display the Maximum critical path latency for each critical resource so you know which ones are causing problems.
A great way to prevent render-blocking resources from slowing down page load speed is to pre-load critical resources. The “avoid chaining critical requests” warning can also appear due to not preloading critical resources.
Additionally, you also want to keep track of all the resources declared with a medium, high, or very high priority. This forces the browser to load resources despite the size of the resource and the resources needed to download it. As a result, it causes a delay in first rendering content on your web page.
How to avoid chaining critical requests
Let’s take a look at some effective ways to avoid chaining critical requests to improve page speed and response times on your WordPress site.
Eliminate render-blocking resources
A great way to eliminate render-blocking resources is by moving all
<link> tags to the bottom of your HTML code. This way, the browser will process those tags at the very end of the critical rendering path. As a result, it frees up more resources for loading critical resources that can help the browser quickly paint pixels on the web page.
In addition to this, you can also add
defer attributes to all non-critical
<link> tags in your HTML code.
You can also eliminate rendering blocking resources by splitting up CSS on your website by media type. This means that you can create separate stylesheets for each type of media type you use on your site. For instance, you can create a separate CSS stylesheet for mobile users and another one for desktop users. This will prevent the browser from loading all the bulky CSS files at once. Instead, it will only request the one that matches the user’s device.
Optimize the critical rendering path
A great way to optimize the critical rendering path is by combining CSS files together. As a result, it reduces the time taken to load CSS files and allows other page elements to load much quicker. You can combine multiple CSS files into one file. This way, the browser won’t take additional time to load multiple CSS files, it only has to load one.
Additionally, you can also reduce the number of CSS files by inlining them into your HTML code. This way, the browser has an easier time processing and executing the CSS files instantly and makes sure content is rendered without page elements causing a layout shift.
Compressing and reducing the size of text-based resources on your web page also works wonders for optimizing the critical rendering path. The smaller your text-based resources are, the faster the browser will be able to process and download them.
Pre-load critical resources
Similarly, you can also preload CSS stylesheets as it can also help reduce the load on the browser when it first starts rendering a web page. In addition to this, you can also pre-load fonts on your web page. You can use the font-display attribute in your code to determine how the font will be displayed while the web page is being downloaded.
With Shoptimizer’s Typography 2.0 feature, fonts on your web pages are optimized from the get-go and don’t cause slower page loading times on your site.
AJAX requests are assigned with a high priority by default. This means that postponing any AJAX requests until the browser has finished rendering content can help ensure fast page load times. This way, the browser doesn’t have to worry about loading AJAX requests while also loading critical resources needed to first display content on your web page.
In some cases, AJAX requests cannot be delayed but that doesn’t mean you cannot do something about it. Preload the AJAX request so the browser knows the AJAX request is available when it needs to download and use it.
For those unfamiliar, an iframe is a page present within another page. This means that an inline frame is used to embed another document into the existing HTML document.
By default, iframes on your web pages are downloaded by the browser at high priority. This not only causes a significant delay in first loading content on the web page but also slows down the whole critical rendering path. As a result, it can cause your web pages to slow down and cause a poor user experience on your site.
One way to delay iframes is by using lazy loading to control the timing of loading iframes. This ensures iframes are not processed and loaded by the browser during the critical rendering process of first loading content on your page. You can use the Lazy Loader plugin to lazy-load iframes on your WordPress website.
Bonus: what else can you do to avoid chaining critical requests?
- Delay loading of content. Most websites delay the loading of content that’s not immediately needed to properly display page elements when the web page first starts loading. The browser later fetches the content when needed via an AJAX request.
- Minify and compress HTML. Compressing and minifying your HTML by removing unnecessary bits of code can help improve page load speeds and prevent the “avoid chaining critical requests” warning.
- Preload images. Only images that need to load in the user’s viewport should be preloaded. This way, the browser will already have the required images downloaded and ready to go when site visitors first land on your WordPress site.
Avoiding chaining critical requests can be challenging.
To recap, here are some ways you can avoid chaining critical requests on your WooCommerce store:
- Eliminate render-blocking resources and optimize the critical rendering path so it’s easy for the browser to process and download quickly.
- Pre-load critical resources so the browser quickly processes critical resources.
- Delay AJAX requests and iframes to improve page speed and get rid of the “avoid chaining critical requests” warning.
Additionally, you can also check out our other tutorials on improving your site’s Core Web Vitals score and ranking in the PageSpeed Insights test:
- How to solve the “avoid an excessive “DOM size” warning.
- Ways to avoid large layout shifts on your website.
With Shoptimizer, you don’t have to worry about avoiding chaining critical requests as it’s performance-optimized from the get-go.