Performance: More Reliable Real-World PageSpeed Insights with Cloudflare

Performance: More Reliable Real-World PageSpeed Insights with Cloudflare

When your income is mostly generated from your online presence, understanding and improving the metrics that your website is judged by is foundational in getting ahead of your competition.

I'm sure you've experienced this exact scenario .. you've googled something, found a product for a good price and click through to their website. Now you're stuck looking at a white page for at least five seconds. During that time, you start wondering about why it is taking so long, perhaps think a bit less of the quality you might expect and oftentimes before the page has loaded you have gone back and selected the next result from Google.

A slow or unstable website can turn visitors away, affecting overall sales. As Google continues to emphasize user experience through its Core Web Vitals, understanding and optimizing these metrics has very important for developers. The way most people test the Core Web Vitals is through Google's PageSpeed report, unfortunately it has some downsides.

This post explores why PageSpeed Insights may not provide a complete picture of your site’s performance and how CloudFlare’s web analytics can offer more interesting insights.

Often when building sites, near towards the end of the build, I obsessively refresh my site’s PageSpeed Insights score, hoping to see the number creeping closer to that magical 100. Every refresh a rollercoaster of emotions—one moment, I was on top of the world with a solid 90, and the next, it plummeted to a disappointing 65.

At the time I didn't realise the inconsistency wasn’t entirely my fault.

The results varied so much, because these tests are conducted from servers located halfway across the globe, far from my site’s hosting servers in Australia. This knowledge made me look for more reliable solutions.

Core Web Vitals

Core Web Vitals are a set of metrics introduced by Google to measure key aspects of user experience on the web. These metrics focus on three primary aspects of web performance:

  1. Largest Contentful Paint (LCP): This measures loading performance. LCP marks the point in the page load timeline when the main content has likely loaded—a good LCP score is 2.5 seconds or faster.
     
  2. First Input Delay (FID): This measures interactivity. FID quantifies the delay users experience when they first try to interact with a page. A good FID score is less than 100 milliseconds.
     
  3. Cumulative Layout Shift (CLS): This measures visual stability. CLS indicates how much the layout shifts during the entire lifespan of the page. A good CLS score is less than 0.1. I'm sure you've come across pages that slowly load in, and just before you're about to tap on an item it moves because some images finally loaded in. Pages like that would have a high CLS metric.

These metrics are crucial because combined they represent a user's experience on your site.

Slow load times, delayed interactivity, and unexpected layout shifts can frustrate users, leading to higher bounce rates and lower conversion rates. Optimizing for these vitals is not just about meeting Google’s standards but also about providing a seamless and pleasant experience for your visitors.

PageSpeed Insights is a very popular tool for measuring web performance and might be fine for some use-cases, but it shouldn't be used a the single reporting source for judging performance of a webiste. This is because it has a number of limitations that can lead to misleading conclusions:

  1. Distance to your Hosting: PageSpeed Insights conducts tests from servers located in various parts of the world. Depending on where these servers are relative to your hosting server, the test results can vary significantly. For instance, if your site is hosted in Australia and the PageSpeed tests are run from America, the additional latency will definitely result in slower load times that don’t reflect the experience of your primary user base.
     
  2. Cold CDN Caches: Content Delivery Networks (CDNs) are crucial for improving site performance by caching content closer to users. However, PageSpeed Insights tests might hit cold CDN caches (caches that haven’t been populated yet), resulting in slower load times. This situation is not representative of real users who typically benefit from warm caches, where content is already stored and quickly accessible.
     
  3. Lack of Consistency: Adhoc tests provide a snapshot of your site’s performance at a specific moment in time. They don’t account for varying conditions throughout the day or week, such as changes in traffic patterns, server load, or internet congestion. Making optimization decisions based on a single snapshot can lead to misguided efforts.

 

Introducing CloudFlare’s Web Analytics

CloudFlare’s web analytics offer a more accurate and comprehensive solution for measuring and optimizing Core Web Vitals.

Here’s how:

  • Targeted Testing: CloudFlare allows you to run performance tests from specific datacenters closer to your hosting servers. This targeted approach ensures that the test results are more representative of the actual user experience. By testing from a location that matches your primary user base, you get a clearer picture of how your site performs for your most important audience.
     
  • Real-User Monitoring: Instead of relying on synthetic tests, CloudFlare collects Core Web Vitals data from real users visiting your site. This real-user monitoring provides a more accurate representation of your site’s performance under actual conditions. You can see how your site performs across different devices, network conditions, and geographic locations.
     
  • Comprehensive Data Collection: CloudFlare’s continuous monitoring offers insights into your site’s performance over time. This approach helps you understand how your site behaves during peak traffic times, after deploying new features, or under different network conditions. Continuous monitoring allows for ongoing optimization, ensuring that your site remains fast and stable regardless of changes.

 

So you now know, PageSpeed Insights can provide useful data, but often falls short in representing the true performance of your website.

CloudFlare’s web analytics offer a more accurate and practical solution by allowing targeted testing and reporting on what your actual users experiences. In turn, you will have a great foundation from which you can make decisions on what parts of your site to improve.

You should take a closer look at how your site performs under real-world conditions. Leverage CloudFlare’s tools to gather accurate data, identify areas for improvement, and implement changes that enhance the user experience. Let me know how you go!