SpeedCurve Blog https://www.speedcurve.com/blog/ Speed matters. Get the latest on how the areas of design and performance overlap with a focus on creating great user experiences. How to provide better attribution for your RUM metrics https://www.speedcurve.com/blog/providing-better-attribution <p><span class="large-para">Here's a detailed walkthrough showing how to make more meaningful and intuitive attributions for your RUM metrics &ndash; which makes it much easier for you to zero in on your performance issues.</span></p> <p><img class="blog-img" src="https://blog-img.speedcurve.com/img/517/better-attributions.gif?auto=format,compress&amp;fit=max&amp;w=2000" alt="" /></p> <p><a href="https://www.speedcurve.com/web-performance-guide/synthetic-vs-real-user-monitoring/">Real user monitoring</a> (RUM) has always been incredibly important for any organization focused on performance. RUM &ndash; also known as field testing &ndash; captures performance metrics as real users browse your website and helps you understand how actual users experience your site. But it&rsquo;s only in the last few years that RUM data has started to become more actionable, allowing you to diagnose what is making your pages slower or less usable for your visitors.</p> <p>Making newer RUM metrics &ndash; such as&nbsp;<a href="https://www.speedcurve.com/web-performance-guide/get-started-with-core-web-vitals/">Core Web Vitals</a>&nbsp;&ndash; more actionable has been a significant priority for standards bodies. A big part of this shift has been better attribution, so we can tell what's actually going on when RUM metrics change.</p> <p>Core Web Vitals metrics &ndash; like Largest Contentful Paint (LCP), Interaction to Next Paint (INP), and Cumulative Layout Shift (CLS) &ndash; all have some level of attribution associated with them, which helps you identify what exactly is triggering the metric. The&nbsp;<a href="https://developer.mozilla.org/en-US/docs/Web/API/Performance_API/Long_animation_frame_timing">LoAF API</a>&nbsp;is all about attribution, helping you zero in on which scripts are causing issues.</p> <p>Having this attribution available, particularly when paired with meaningful subparts, can help us to quickly identify which specific components we should prioritize in our optimization work.</p> <p>We can help make this attribution even more valuable by ensuring that key components in our page have meaningful, semantic attributes attached to them.</p><h2>How the browser handles attribution</h2> <p>When a metric that has some level of attribution associated with it &ndash; like LCP or INP &ndash; is triggered, the browser provides us with the element that triggered the measurement.</p> <p>For the Largest Contentful Paint (LCP) metric, for example, attribution is provided in the <code>element</code> property.</p> <p><img class="blog-img" src="https://blog-img.speedcurve.com/img/517/screenshot_2024-08-21_at_8.55.39_am.png?auto=format,compress&amp;fit=max&amp;w=2000" alt="A screenshot showing properties for the LCP metric" /></p> <p>For Interaction to Next Paint (INP), attribution comes in the form of the <code>target</code> property:</p> <p><img class="blog-img" src="https://blog-img.speedcurve.com/img/517/screenshot_2024-08-21_at_8.56.11_am.png?auto=format,compress&amp;fit=max&amp;w=2000" alt="A screenshot showing properties for the INP metric" /></p> <p>In either case, the browser will provide us with a selector for that specific element containing any class or ID attributes that may be applied.</p> <p>Consider the following three links:</p> <p><img class="blog-img" src="https://blog-img.speedcurve.com/img/517/carbon-(5).png?auto=format,compress&amp;fit=max&amp;w=2000" alt="" /></p> <p>If the first link is clicked and triggers an INP, we will get a <code>target</code> of <code>a.btn-primary</code>. For the second link, the browser will return <code>a#myLink</code>. For the third, since there are no classes or IDs to provide, the browser will simply provide us with a <code>target</code> of <code>a</code> .</p> <p>Already, there&rsquo;s a meaningful difference in what we see for attribution. Since IDs are required to be unique on a page, we can quickly grab the <code>#myLink</code> attribute and figure out which element is responsible.</p> <p>The other two targets are not as clear. There could be any number of links on our page triggering the <code>a</code> target, and classes are not required to be unique, so we could be staring at a bunch of <code>a.btn-primary</code>'s in our page as well.</p> <p>At this point, many RUM providers (like SpeedCurve) will try to help you out by walking back up the elements in your page to provide you with a more complete and specific path to the target element.</p> <p>To do this, they will start by fetching the parent element of the target element, and record both the type of element and any classes or IDs associated with it.</p> <p>For example, consider the following markup:</p> <p><img class="blog-img" src="https://blog-img.speedcurve.com/img/517/carbon-(4).png?auto=format,compress&amp;fit=max&amp;w=2000" alt="" /></p> <p>The browser will provide us with a target of <code>a.classButton</code>, but many RUM providers (ourselves included), will walk up the DOM and provide you with an element selector of:</p> <p style="padding-left: 30px;"><code>div.main&gt;div.large&gt;p.center&gt;a.classButton</code></p> <p>The goal is to provide you with as unique a path as possible to help you pinpoint exactly which element on your page is involved.</p> <p>In SpeedCurve, that attribution is provided for both LCP and INP so you can quickly identify exactly what components are impacting your performance. Here&rsquo;s an example heatmap from SpeedCurve showing this selector in action:</p> <p><img class="blog-img" src="https://blog-img.speedcurve.com/img/517/screenshot_2024-08-21_at_8.29.41_am.png?auto=format,compress&amp;fit=max&amp;w=2000" alt="A screenshot of SpeedCurve's heatmap for INP" /></p> <p>Some of these selectors (<code>#playBtnStartIcon</code>, <code>#cmpWrapper</code> , etc) are fairly intuitive. But notice the complex path to some of the other INP triggers.</p> <p>For example, we could probably figure this out, but it&rsquo;s going to take us hopping into the source of the page to drill into what element exactly is triggering this one:</p> <p style="padding-left: 30px;"><code>article.article-body.prose.max-w-none.pb-7.pt-5.prose-figure:max-w-full.prose-ol:pl-10&gt;p&gt;a</code></p> <p>In this case, the browser wasn&rsquo;t even able to find a class name so we just get a series of div selectors that is going to be tricky to hunt down:</p> <p style="padding-left: 30px;"><code>div&gt;div&gt;div&gt;div&gt;div&gt;div&gt;div&gt;div&gt;div</code></p> <p>Contrast that with the attribution for the play button (<code>#playBtnStartIcon</code>). This selector is immediately intuitive (and short!) because we had a meaningful ID on the element itself, so there was no need to walk up the DOM and get a long list of selectors.</p> <h2>Making attribution meaningful</h2> <p>We can make it much easier for ourselves to quickly identify what elements are involved by ensuring that key components on our page have meaningful flags for attribution.</p> <p>With SpeedCurve, there are two ways of accomplishing this:</p> <ul> <li>providing a relevant `id` attribute</li> <li>using the `data-sctrack` attribute</li> </ul> <h3>Using a relevant `id` attribute</h3> <p>One option we have is to provide an <code>id</code> attribute on our key components. While SpeedCurve is working to provide you with a meaningful selector, as soon as an element with an <code>id</code> is discovered, we will stop walking up the DOM. The <code>id</code> attributed is required to be unique, so we&rsquo;re able to provide just that.</p> <p>You&rsquo;ve already seen an example of this where the target element itself had an ID directly applied to it, but this also works for shortening the selector in general.</p> <p>Let&rsquo;s revisit our markup from earlier, but this time we&rsquo;ll add an ID to our entry paragraph:</p> <p><img class="blog-img" src="https://blog-img.speedcurve.com/img/517/carbon-(6).png?auto=format,compress&amp;fit=max&amp;w=2000" alt="" /></p> <p>The browser will still provide a <code>target</code> of <code>a.classButton</code>, but now SpeedCurve will walk up the DOM, see the unique ID and provide a much more intuitive element selector of <code>#heroParagraph&gt;a.classButton</code> .</p> <h3>Using the `data-sctrack` attribute</h3> <p>In SpeedCurve, we provide you with an alternative approach to attribution, in case you would rather not sprinkle a bunch of ID&rsquo;s throughout your markup.</p> <p>Our RUM script&nbsp;<a href="https://support.speedcurve.com/docs/rum-js-api#data-sctrack">will also look for the <code>data-sctrack</code> attribute</a> while trying to generate our element selector.</p> <p>There&rsquo;s one important difference here between how <code>data-sctrack</code> and <code>id</code> are used. In the case of <code>id</code>, we treat that attribute as part of a selector path. If we find a <code>data-sctrack</code> attribute, however, we will simply provide the value of that attribute&mdash;not a full selector path.</p> <p>For example, in the previous markup, the element selector provided was <code>#heroParagraph&gt;a.classButton</code>. If, however, we adjusted our markup to use a <code>data-sctrack</code> attribute like so:</p> <p><img class="blog-img" src="https://blog-img.speedcurve.com/img/517/carbon-(7).png?auto=format,compress&amp;fit=max&amp;w=2000" alt="" /></p> <p>The element selector we would provide would be <code>heroParagraph</code> , not the full path to the link itself.</p> <p>Neither approach is necessarily inherently better than the other. It comes down to your specific approach to markup, and the components you&rsquo;re using.</p> <p><!-- notionvc: 8b68f536-2e5b-4bf9-ae91-254369c75415 --></p> <p>In either case, however, providing unique <code>id</code> &rsquo;s or <code>data-sctrack</code> attributes on your page will result in much more meaningful and intuitive attribution, making it much easier for you to zero in on your performance issues.</p> <p><a href="https://www.speedcurve.com/signup/"><img class="blog-img" src="https://blog-img.speedcurve.com/img/517/customer-logos-free-trial-banner.png?auto=format,compress&amp;fit=max&amp;w=2000" alt="" /></a></p> Tue, 03 Sep 2024 00:00:00 +1200 NEW: Paper cuts update! https://www.speedcurve.com/blog/paper-cuts <p><span class="large-para">Paper cut: (literal) A wound caused by a piece of paper or any thin, sharp material that can slice through skin. (figurative) A trivial-seeming problem that causes a surprising amount of pain.</span></p> <p><img class="blog-img" src="https://blog-img.speedcurve.com/img/516/bandage-thumbs-up.jpg?auto=format,compress&amp;fit=max&amp;w=2000" alt="" /></p> <p>We all love big showy features, and this year we've released our share of those. But sometimes it's the small stuff that can make a big difference. We recently took a look at our backlog of smaller requests from our customers &ndash; which we labelled "paper cuts" &ndash; and decided to dedicate time to tackle them.</p> <p>Are they <em>all</em> glamorous changes? Maybe not, though some are pretty exciting.</p> <p>Are they worthy of a press release? Ha! We don't even know <em>how</em> to issue a press release.</p> <p>Will they make your day better and put a smile on your face? We sure hope so.</p> <p>In total, our wonderful development team tackled more than 30 paper cuts! These include:</p> <ul> <li>Exciting new chart types for Core Web Vitals and User Happiness</li> <li>Filter RUM data by region</li> <li><span style="color: #1f1f1f;">Create a set of tests for one or multiple sites or custom URLs</span></li> <li><span style="color: #1f1f1f;">Test directly from your site settings when saving changes</span></li> <li>Usability improvements</li> <li>Better messaging for test failures</li> <li>And more!</li> </ul> <p>Keep scrolling for an overview of some of the highlights.&nbsp;</p><h2>On-demand testing updates</h2> <p>This has been an area we've focused on a lot this year. We made a lot of <a href="https://www.speedcurve.com/blog/on-demand-web-performance-testing/">updates to the Test Now functionality</a>&nbsp;back in February of this year. One of the biggest requests from our users was the ability to test a single url within a site. Using the 'Test Now' modal, you can now select anywhere from one to many URLs to test on demand.<br /><br /><img class="blog-img" src="https://blog-img.speedcurve.com/img/516/url_test.gif?auto=format,compress&amp;fit=max&amp;w=2000" alt="On-demand testing modal showing the ability to test individual urls" /></p> <p>In addition, we've given you the ability to test directly from your site settings when saving changes.</p> <p><img class="blog-img-md" src="https://blog-img.speedcurve.com/img/516/testnowsettings.gif?auto=format,compress&amp;fit=max&amp;w=2000" alt="Save and Test button in site settings" /></p> <p>If you are a user of our API, make sure you check out the <a href="https://support.speedcurve.com/reference/create-a-snapshot">new snapshots endpoint</a> in our v2 API (currently in beta). This endpoint provides the ability to create a set of tests for one or multiple sites or custom URLs.</p> <h2>UI updates</h2> <p>Okay, so maybe this one is a little more flashy than we let on. We've updated our User Happiness and Core Web Vitals RUM time series charts to 100% stacked column charts in our Performance and Users dashboards. This gives you the ability to see the distribution of users in each bucket of User Happiness, as well as thresholds for Core Web Vitals.&nbsp;</p> <p><img class="blog-img" src="https://blog-img.speedcurve.com/img/516/stacked-happiness.gif?auto=format,compress&amp;fit=max&amp;w=2000" alt="100% stacked bar chart for user happiness metric" /></p> <p>In addition, we've added page views time series data to our Core Web Vitals time series charts. This is incredibly helpful and adds a layer of context to the data. A common pattern is seeing metrics degrade during low traffic times due to the size of the sample, caching inefficiency (for example, cold CDN cache), and routine maintenance.</p> <p><img class="blog-img" src="https://blog-img.speedcurve.com/img/516/stackecwv.gif?auto=format,compress&amp;fit=max&amp;w=2000" alt="100% stacked chart and time series for core web vitals" /></p> <h2>Regional performance</h2> <p>We've had the ability to segment data by country since the inception of RUM. We are now exposing the second-level geography (region) in our tables in the Performance dashboard. For customers looking to move more to the edge and get the most from their investment in distributed computing and content delivery networks, having an understanding of how pages perform within the borders of a country is extremely useful.</p> <p><img class="blog-img" src="https://blog-img.speedcurve.com/img/516/regions.gif?auto=format,compress&amp;fit=max&amp;w=2000" alt="Regional performance for the US." /></p> <h2>A whole lot more...</h2> <p>There were more than 30 paper cuts tackled by our wonderful development team. These included usability improvements, better messaging for test failures additional filtering options and more. We hope you enjoy these updates. We really enjoyed tackling them.&nbsp;</p> <p>Have a paper cut you'd like us to tackle? <a href="mailto:support@speedcurve.com">Let us know!</a></p> <p><a href="https://www.speedcurve.com/signup/"><img class="blog-img" src="https://blog-img.speedcurve.com/img/516/customer-logos-free-trial-banner.png?auto=format,compress&amp;fit=max&amp;w=2000" alt="" /></a></p> Mon, 19 Aug 2024 00:00:00 +1200 NEW: Improving how we collect RUM data https://www.speedcurve.com/blog/improving-how-we-collect-rum-data <p><span class="large-para">We've made improvements to how we collect RUM data. Most SpeedCurve users won't see significant changes to Core Web Vitals or other metrics, but for a small number of users some metrics may increase.</span></p> <p><img class="blog-img" src="https://blog-img.speedcurve.com/img/515/rum-changes.png?auto=format,compress&amp;fit=max&amp;w=2000" alt="" /></p> <p>This post covers:</p> <ul> <li>What the changes are</li> <li>How the changes can affect Core Web Vitals and other metrics</li> <li>Why we are making the changes now</li> </ul><h2>What's changing?</h2> <p>By default, SpeedCurve RUM used to send its main beacon shortly after the load event fires, another soon after the visitor first interacts with the page, and then further beacons as User Timing marks and measures (AKA custom metrics) are added.</p> <p>This approach was sound when our main focus was measuring how quickly pages loaded or routes changed. But newer metrics &ndash; such as Cumulative Layout Shift (CLS) and Interaction to Next Paint (INP) &ndash; don't stop at page load or first interaction. As a result, they need to be measured throughout the entire lifecycle of the page.</p> <p>To work around some of the limitations of the current approach, we've&nbsp;<a href="https://support.speedcurve.com/docs/rum-js-api#luxminmeasuretime">added options that allow sites to delay when they send the beacon,</a>&nbsp;but these must be implemented on a site-by-site basis &ndash; which isn't ideal.</p> <p>Starting August 7, 2024, we've improved our defaults. <strong>Now performance metrics will be captured for longer and beacons will be sent at the earliest of 60 seconds after page load starts, or when the visitor leaves the page if that happens sooner.</strong></p> <p>Sites such as SPAs, which use&nbsp;&nbsp;<code>LUX.auto = false</code>&nbsp;to control when they send the beacons themselves, are opted out of our default behaviour and won't see any changes.</p> <p>To understand which metrics are affected and how much they change, we've run the old and new measurement pipelines in side-by-side and compared the data each produces.</p> <h2>How your Core Web Vitals may change</h2> <p>Most customers won't see significant changes to Core Web Vitals or other metrics, but for a small number of customers some metrics will increase.</p> <p>Some metrics are fixed at the point they're measured, while others can change with time or as a result of user interaction.</p> <p>First Contentful Paint is an example of a metric that's fixed in time. It's the timestamp of when the browser first displayed content. Because there is only ever one first paint, it can't change after that point.</p> <p>Other metrics can change. A page can display a larger image, content can move around, and visitors can trigger slower interactions.</p> <p>Sending the beacon later means we have a longer window to watch for changes to these metrics, and in some cases we can capture changes that we could not detect previously.</p> <p>The metrics that we've seen increase for some customers are:</p> <ul> <li>Largest Contentful Paint (LCP)</li> <li>Cumulative Layout Shift (CLS</li> <li>Interaction to Next Paint (INP)</li> </ul> <p>Here are some examples of things we've come across that can lead to metrics increasing as a result of sending the beacon later:</p> <h3>Largest Contentful Paint (LCP)</h3> <p>LCP stops being measured when there's an <strong>Input Event</strong> (click, tap or keypress) or the visitor scrolls the page.</p> <p><strong>Hover Events</strong> aren't classed as Input Events. If a Hover event triggers a larger image to be loaded or a larger text paint, that can cause LCP to increase.<br /><br />Two examples where we've seen LCP increase due to visitor interaction:</p> <ul> <li>Product pages that show zoomed product images on hover</li> <li>Desktop 'mega-menus' where the images embedded in it are larger than the main images on the page</li> </ul> <p>Here's an example from a retailer's category page. The promotional banner at the bottom of the menu is larger than the product cards. As a result, the banner will become the LCP element when the menu is shown.</p> <p style="text-align: center;"><img class="blog-img" src="https://blog-img.speedcurve.com/img/515/menu-banner-casues-new-lcp.png?auto=format,compress&amp;fit=max&amp;w=2000" alt="Promotional Banner in menu becomes LCP when it's shown on hover" /><em>Promotional banner becomes LCP element when a visitor hovers on the menu</em></p> <p>The hover behaviour is a known 'gotcha' for LCP. If you're interested in following how it might change in the future, there's <a href="https://github.com/w3c/largest-contentful-paint/issues/108">an issue against the specification that discusses it further</a>.</p> <p>The other common case where we've seen LCP increase is when a script triggers a late large paint, for example by displaying a dialog for a consent manager or an email subscription popup.</p> <p><strong>These examples highlight that LCP doesn't always measure the most important content.</strong> This is why I encourage sites to <a href="https://www.speedcurve.com/blog/element-timing-one-true-metric/">use Element Timing to measure the visual elements that really matter to their user experience</a>.</p> <h3>Cumulative Layout Shift (CLS)</h3> <p>Layout shifts that are triggered within 500ms of a user's interaction are ignored for CLS; however, scrolling is not considered an interaction for CLS purposes, so content that moves around or changes size as someone scrolls will create new layout shifts and potentially a higher CLS score.</p> <p>News sites &ndash; where advertisements are lazy-loaded or refreshed as the page scrolls and the advert creative is larger than the space reserved for it &ndash; are an example where CLS scores can get worse due to the longer measurement time.</p> <p>Here's a news article where an ad creative loads on scroll. The publisher has reserved space for the ad unit, but the creative that loads is larger than the space. As a result, there's a layout shift as the content below the ad is pushed down.</p> <p><img class="blog-img" src="https://blog-img.speedcurve.com/img/515/lazy-loaded-ad-slot-causes-layout-shift-.png?auto=format,compress&amp;fit=max&amp;w=2000" alt="Layout Shift triggered by lazy loaded ad creative" /></p> <p style="text-align: center;"><em>Layout Shift triggered by an lazy loaded advert whose creative is larger than the space reserved for it</em></p> <p>Scripts that are triggered by the load event, or a long timer and insert content into the page, are another example where CLS may increase.</p> <h3>Interaction to Next Paint (INP)</h3> <p>Visitors may interact with a page more than once. A shopper might examine different images of an item before adding it to their basket. Someone might like multiple posts on a social network before responding to one of their friends. There's no guarantee which of these interactions will generate the highest INP time.</p> <p>By extending the wait before we send the RUM beacon, we're more likely to capture the slowest and most annoying interaction on the page.</p> <h2>Why we changed our approach</h2> <p>We identified that we needed to capture data for a longer time a while ago, but constraints in our RUM processing pipeline made it difficult to implement.</p> <p>Our existing pipeline has served us well. Using Fastly's beacon termination service to capture and forward RUM data, and VCL to enrich it, has proved really robust over the last eight years. But as our product has grown and new metrics have been introduced, the pipeline has become more complex. As a result, we've started to run into the pipeline's limitations more frequently.</p> <p>We knew that sooner or later we'd need to re-engineer the pipeline. As part of adding diagnostics for Core Web Vitals, we've re-implemented the pipeline using Fastly's edge compute. (We're saving a deeper overview of our new pipeline for another post.)</p> <p>Sending the beacon later has a number of benefits, now and down the road:&nbsp;</p> <ul> <li>Improves the accuracy of the metrics we're capturing&nbsp;</li> <li>Allows us to simplify our RUM processing pipeline</li> <li>Made it easier to implement attribution for INP and LCP</li> <li>Smooths the way for adding other features we have planned for the future</li> </ul> <p>That sounds like a win for everyone.</p> <p>If you've any questions about the changes, or notice something in your data that you can't explain we'd love to hear from you. Send us a note at&nbsp;support@speedcurve.com.</p> <p><a href="https://www.speedcurve.com/signup/"><img class="blog-img" src="https://blog-img.speedcurve.com/img/515/customer-logos-free-trial-banner.png?auto=format,compress&amp;fit=max&amp;w=2000" alt="" /></a></p> Wed, 07 Aug 2024 00:00:00 +1200 15 page speed optimizations that sites ignore (at their own risk) https://www.speedcurve.com/blog/15-neglected-page-speed-optimizations <p><span class="large-para">A recent analysis of twenty leading websites found a surprising number of page speed optimizations that sites are not taking advantage of &ndash; to the detriment of their performance metrics, and more importantly, to the detriment of their users and ultimately their business.</span></p> <p><img class="blog-img" src="https://blog-img.speedcurve.com/img/483/optimizations-hero.png?auto=format,compress&amp;fit=max&amp;w=2000" alt="" /></p> <p>I spend a lot of time looking at waterfall charts and web performance audits. I recently investigated the test results for twenty top sites and discovered that many of them are not taking advantage of optimizations &ndash; including some fairly easy low-hanging fruit &ndash; that could make their pages faster, their users happier, and their businesses more successful.</p> <p>More on this below, but first, a few important reminders about the impact of page speed on businesses...</p><h2>Slow pages hurt your business</h2> <p>In user survey after user survey over the past decade or so, site speed has emerged as one of the greatest factors that determine a person's satisfaction with a website (second only to security). Because&nbsp;<a href="https://www.speedcurve.com/web-performance-guide/the-psychology-of-web-performance/">our "need for speed" is deeply rooted in our neural wiring</a>, it's unlikely to change, no matter how much we wish it could.</p> <p>In case you have any doubts,&nbsp;<a href="https://wpostats.com/">countless case studies</a>&nbsp;have proven a consistent and demonstrable correlation between page speed and business and user engagement metrics like conversions, bounce rate, and search rank. Just a few examples:</p> <ul> <li><strong>Walmart</strong>&nbsp;found that every 1 second of improvement equaled a&nbsp;<a href="https://wpostats.com/2015/11/04/walmart-revenue.html">2% increase in conversion rate</a>.</li> <li><strong>Vodafone</strong>&nbsp;improved their Largest Contentful Paint (LCP) time by 31%, resulting in an&nbsp;<a href="https://web.dev/case-studies/vodafone">8% increase in sales, a 15% increase in their lead-to-visit rate, and an 11% increase in their cart-to-visit rate</a>.</li> <li><strong>NDTV</strong>, one of India's leading news stations and websites, improved LCP by 55% and saw a&nbsp;<a href="https://web.dev/case-studies/ndtv">50% reduction in bounce rate</a>.</li> <li><strong>ALDO</strong>&nbsp;found that on their single-page app, mobile users who experienced fast rendering times brought 75% more revenue than average, and&nbsp;<a href="https://simplified.dev/performance/impact-of-web-performance">327% more revenue</a>&nbsp;than those experiencing slow rending times. On desktop, users with fast-rendering times brought in 212% more revenue than average and 572% more than slow.</li> </ul> <h2><span style="font-size: 35px;">How much faster than your competitors do you need to be?</span></h2> <p>It's not enough to be fast. You need to be faster than the competition. If you're not, your customers could be quietly drifting away. In a traditional brick-and-mortar scenario, abandoning one store for another takes effort. On the web, it takes a couple of clicks.&nbsp;</p> <p>The margin for speed is tight. Way back in 2012, Harry Shum (then EVP of Technology and Research at Microsoft) <a href="https://www.nytimes.com/2012/03/01/technology/impatient-web-users-flee-slow-loading-sites.html">said</a>:</p> <blockquote> <p>"Two hundred fifty milliseconds, either slower or faster, is close to the magic number now for competitive advantage on the Web."</p> </blockquote> <p>With many synthetic monitoring tools, you can&nbsp;<a href="https://support.speedcurve.com/docs/competitive-benchmarking">benchmark your site against your competitors</a>. Competitive benchmarking is a great way to see how you stack up &ndash; and how much you need to improve.</p> <p>This is why it's crucial to take advantage of any optimization technique that could help give you a competitive advantage.</p> <p style="text-align: center;"><a href="https://app.speedcurve.com/benchmarks/usa/retail/fast/start-render/"><img class="blog-img" src="https://blog-img.speedcurve.com/img/483/benchmarks.png?auto=format,compress&amp;fit=max&amp;w=2000" alt="" /></a></p> <p style="text-align: center;"><a href="https://app.speedcurve.com/benchmarks/usa/retail/fast/start-render/"><em>US Retail Benchmarks leaderboard</em></a></p> <h2>Background: Looking at 20 leading sites</h2> <p>For this investigation:</p> <ul> <li>I looked at the synthetic test results for twenty randomly selected industry-leading sites, taken from SpeedCurve's <a href="https://app.speedcurve.com/benchmarks/">Page Speed Benchmarks</a> dashboard.</li> <li>I then tallied the pass/fail status for common performance recommendations (AKA performance audits).</li> </ul> <p><strong><a href="https://app.speedcurve.com/benchmarks/">Page Speed Benchmarks</a> is an interactive set of dashboards that anyone can explore and use for their own research.</strong> Every day we run a synthetic test for the home pages of industry-leading websites and rank them based on how fast their pages appear to load from a user&rsquo;s perspective. You can filter the dashboard to rank sites based on common web performance metrics, such as Start Render, Largest Contentful Paint, Cumulative Layout Shift, Time to Interactive, and more.&nbsp;</p> <p><strong>The Benchmarks dashboard also allows you to drill down and get detailed test results for each page</strong>, including waterfall charts, Lighthouse scores, and recommended optimizations/audits. Looking at these test details lets you see how the fastest and slowest pages in the dashboards are built &ndash; what they're doing right, as well as missed opportunities for optimization.</p> <p><img class="blog-img" src="https://blog-img.speedcurve.com/img/483/lighthouse-scores-audits.png?auto=format,compress&amp;fit=max&amp;w=2000" alt="" /></p> <p style="text-align: center;"><em>Lighthouse scores and performance audits, taken from <a href="https://app.speedcurve.com/benchmark/media-eu/test/240704_4F_12b674ea9f73a94489c82665d1ae5b52/?share=freljsuj6913s9s5an29pktz92alec">this synthetic test result</a></em></p> <p>For the twenty sites I looked at, below are the most common page speed optimizations those sites were not taking advantage of, ranked from least to most implemented.</p> <h2>Serve static assets with an efficient cache policy</h2> <p><strong>Metric(s) affected:</strong> Rendering metrics for repeat views</p> <p>The first time you visit a site, it's likely that your browser won't have any of the resources it needs to load the page already stored in its cache. This is often referred to as a <strong>cold cache</strong>. This state is very typical for sites that don't get a lot of repeat visitors over a short duration.&nbsp;For many other sites, such as your favourite media or shopping sites, repeat views are very common.</p> <p>For sites that receive a lot of repeat visitors, <a href="https://www.speedcurve.com/web-performance-guide/leveraging-browser-caching-for-faster-load-times/">taking advantage of the browser cache</a> is a big performance win. <strong>Yet only 1 out of the 20 pages I looked at had an efficient cache policy.</strong></p> <p><img class="blog-img-md" src="https://blog-img.speedcurve.com/img/483/1-efficient-cache.png?auto=format,compress&amp;fit=max&amp;w=2000" /></p> <p><strong>Fix:&nbsp;</strong><a href="https://developer.chrome.com/docs/lighthouse/performance/uses-long-cache-ttl/">Setting appropriate HTTP headers for page resources</a> is the best way to make sure you are optimally caching content for your site.&nbsp;</p> <h2>Reduce unused JavaScript</h2> <p><strong>Metric(s) affected:</strong> Largest Contentful Paint</p> <p>There's a shocking number of zombie scripts out there, slowly killing performance. Unused JS can hurt your site in a number of ways, from render-blocking scripts that prevent your page from loading to competing with essential JS for bandwidth, especially on mobile and low-powered devices. <strong>Only 3 out of 20 sites passed this audit.</strong></p> <p><img class="blog-img-md" src="https://blog-img.speedcurve.com/img/483/2-unused-javascript.png?auto=format,compress&amp;fit=max&amp;w=2000" /></p> <p><strong>Fix:</strong>&nbsp;<a href="https://developer.chrome.com/docs/lighthouse/performance/unused-javascript/">Reduce unused JavaScript</a> and, when possible, defer scripts until they're required.&nbsp;</p> <h2>Page prevented back-forward cache restoration</h2> <p><strong>Metric(s) affected:</strong> Rendering metrics for repeat views</p> <p>Many navigations are performed by going back to a previous page and forward again. Back/forward cache (or bfcache) stores the entire page so that it's available and renders nigh instantaneously. It doesn't require special HTTP headers and is now supported across all major browsers.</p> <p>For sites that have a lot of back/forward navigations, taking advantage of the bfcache remains one of the biggest opportunities to deliver a page load experience that feels seamless. <strong>Yet&nbsp;16 out of 20 sites did not have bfcache restoration enabled</strong>.</p> <p><img class="blog-img-md" src="https://blog-img.speedcurve.com/img/483/3-bfcache.png?auto=format,compress&amp;fit=max&amp;w=2000" /></p> <p><strong>Fix:</strong> <a href="https://www.speedcurve.com/web-performance-guide/leveraging-browser-caching-for-faster-load-times/">Leverage the browser cache</a> to reduce the number of HTTP requests.&nbsp;</p> <h2>Image elements do not have explicit 'width' and 'height'</h2> <p><strong>Metric(s) affected:</strong> Cumulative Layout Shift&nbsp;</p> <p>Without height and width attributes, your images fly around the page trying to figure out how to resolve and settle down in each individual user's browser. This can really hurt your <a href="https://www.speedcurve.com/web-performance-guide/understanding-and-improving-cumulative-layout-shift/">Cumulative Layout (CLS)</a> score. CLS is a Core Web Vital, which means it's an important factor in Google's search algorithm. The worse your CLS score, the greater risk of hurting your SEO rank.</p> <p>More to the point, a poor CLS score tells you that your pages feel super janky and unstable. Page jank is an irritant for everyone, but it's a major accessibility problem for people with disabilities that affect fine motor skills.&nbsp;</p> <p>All this goes to say that it's very surprising to see that <strong>14 out of 20 sites failed this audit</strong>.&nbsp;</p> <p><img class="blog-img-md" src="https://blog-img.speedcurve.com/img/483/4-image-height-width.png?auto=format,compress&amp;fit=max&amp;w=2000" /></p> <p><strong>Fix:</strong>&nbsp;<a href="https://web.dev/articles/optimize-cls#images-without-dimensions">Set an explicit width and height</a> on all image and video elements.&nbsp;Alternatively, reserve the required space with CSS <code>aspect-ratio</code> or similar.</p> <h2>Minimize main-thread work</h2> <p><strong>Metric(s) affected:</strong> Largest Contentful Paint, Total Blocking Time (to name just a couple)</p> <p>Geoff Graham provides a good analogy for the browser main thread <a href="https://www.smashingmagazine.com/2023/10/speedcurve-fight-main-thread/">here</a>:</p> <blockquote> <p>I&rsquo;ve heard the main thread described as a highway that gets cars from Point A to Point B; the more cars that are added to the road, the more crowded it gets and the more time it takes for cars to complete their trip. This particular highway has just one lane, and it only goes in one direction. there&rsquo;s only one way to go, and everything that enters it must go through it... Each resource on a page is a contender vying for a spot on the thread and wants to run first. If one contender takes its sweet time doing its job, then the contenders behind it in line just have to wait.</p> </blockquote> <p>When you understand how hard all a page's resources are fighting for the main thread, it's easy to understand why minimizing main-thread work is a crucial page speed optimization strategy. It's not uncommon to see pages where main-thread work could be reduced by 8-10 seconds or more! <strong>Of the 20 sites I looked at, 13 failed this audit.</strong></p> <p><img class="blog-img-md" src="https://blog-img.speedcurve.com/img/483/5-minimize-main-thread.png?auto=format,compress&amp;fit=max&amp;w=2000" /></p> <p><strong>Fix:</strong> <a href="https://developer.chrome.com/docs/lighthouse/performance/mainthread-work-breakdown/">Reduce the time spent parsing, compiling and executing JS.</a> You may find delivering smaller JS payloads helps with this.&nbsp;</p> <h2>Reduce JavaScript execution time</h2> <p><strong>Metric(s) affected:</strong> Interaction to Next Paint, Total Blocking Time</p> <p>JavaScript is, by default, parser blocking. That means that when the browser finds a JavaScript resource, it needs to stop parsing the HTML until it has downloaded, parsed, compiled, and executed that JavaScript. Only after all of that is done can it continue to look through the rest of the HTML and start to request other resources and get on its way to displaying the page.</p> <p>For the 20 sites I looked at, <strong>there was a 50/50 pass/fail rate for this audit</strong>.</p> <p><img class="blog-img-md" src="https://blog-img.speedcurve.com/img/483/6-js-execution.png?auto=format,compress&amp;fit=max&amp;w=2000" /></p> <p><strong>Fix:</strong> <a href="https://www.speedcurve.com/web-performance-guide/best-practices-for-optimizing-javascript/">There are several things you can do</a>, including minification and compression, serving JS asynchronously (or deferring it), avoiding layout thrashing, and yielding to the main thread. The most radical solution: wherever possible, don't use JavaScript!&nbsp;</p> <h2>Avoid enormous network payloads (AKA page size)</h2> <p><strong>Metric(s) affected:</strong> Largest Contentful Paint</p> <p>I've stopped being shocked when I see pages that are upwards of 10, 20, and even 30 MB in size. Large network payloads can cost users real money and are highly correlated to slow load times. The main culprits: huge image and video files, along with unoptimized JavaScript.&nbsp;</p> <p>If a page is greater than 5,000 KB in size, then it fails this audit. <strong>Of the 20 sites I looked at, 9 failed &ndash; meaning they were larger than 5,000 KB.</strong></p> <p><img class="blog-img-md" src="https://blog-img.speedcurve.com/img/483/7-network-payload.png?auto=format,compress&amp;fit=max&amp;w=2000" /></p> <p><strong>Fix:</strong> <a href="https://developer.chrome.com/docs/lighthouse/performance/total-byte-weight/">Reduce payload size.</a> For first views, you can optimize resources like images and videos to be as small as possible. For repeat views, leverage the browser cache as recommended earlier in this post.</p> <h2>Serve images in next-gen formats</h2> <p><strong>Metric(s) affected:</strong>&nbsp;Start Render, Largest Contentful Paint</p> <p>Image formats like WebP and AVIF often provide better compression than PNG or JPEG, which means faster downloads and less data consumption.<strong>&nbsp;11 out of 20 sites passed this audit.</strong></p> <p><img class="blog-img-md" src="https://blog-img.speedcurve.com/img/483/8-images-next-gen.png?auto=format,compress&amp;fit=max&amp;w=2000" /></p> <p><strong>Fix:</strong>&nbsp;<a href="https://www.speedcurve.com/web-performance-guide/best-practices-for-optimizing-images/">Explore alternative image formats.</a> AVIF is supported in Chrome, Firefox, and Opera and offers smaller file sizes compared to other formats with the same quality settings. WebP is supported in the latest versions of Chrome, Firefox, Safari, Edge, and Opera and provides better lossy and lossless compression for images on the web.&nbsp;</p> <h2>Ensure text remains visible during webfont load</h2> <p><strong>Metric(s) affected:</strong>&nbsp;Start Render, Largest Contentful Paint</p> <p>Some web fonts can be large resources, which means they render slowly. Because fonts are often one of the first resources to be called by the browser, a slow font can relay all your downstream metrics. And depending on the browser, the text might be completely hidden until the font loads. The resulting <strong>flash of invisible text</strong> (FOIT) is a UX annoyance.</p> <p>Despite all those very good reasons to optimize font rendering, <strong>7 out of 20 sites failed this audit</strong>.</p> <p><img class="blog-img-md" src="https://blog-img.speedcurve.com/img/483/9-text-fonts.png?auto=format,compress&amp;fit=max&amp;w=2000" /></p> <p><strong>Fix:</strong>&nbsp;<a href="https://developer.chrome.com/docs/lighthouse/performance/font-display/">Leverage the <code>font-display</code> CSS feature</a> to ensure text is visible to users while web fonts are loading.</p> <h2>Reduce the impact of third-party code</h2> <p><strong>Metric(s) affected:</strong> Total Blocking Time, Largest Contentful Paint, Interaction to Next Paint</p> <p>These days, a typical web page can contain dozens of third-party scripts. All that extra code &ndash; which you don't have much control over &ndash; can significantly affect the speed of your pages. A single non-performant blocking script can completely prevent your page from rendering. The good news is that only <strong>4 out of 20 sites failed this audit</strong> (though that number is still too high).</p> <p><img class="blog-img-md" src="https://blog-img.speedcurve.com/img/483/10-third-parties.png?auto=format,compress&amp;fit=max&amp;w=2000" /></p> <p><strong>Fix:</strong> While you can't always do much about your third-party vendors, <a href="https://www.speedcurve.com/web-performance-guide/third-party-web-performance/">you still have a number of options available</a>, including limiting the number of redundant third-party providers and loading third-party code after your page has primarily finished loading.</p> <h2>Reduce unused CSS</h2> <p><strong>Metrics affected:</strong> Start Render, Total Blocking Time, Largest Contentful Paint</p> <p>By default, the browser has to download, parse, and process all stylesheets before it can display any content. Like unused JavaScript, unused CSS clutters your pages, creates extra network trips, unnecessarily adds to your total payload, and ultimately slows down user-perceived performance. Decluttering your pages pays off, yet <strong>4 out of 20 sites failed this audit</strong>.</p> <p><img class="blog-img-md" src="https://blog-img.speedcurve.com/img/483/11-reduce-css.png?auto=format,compress&amp;fit=max&amp;w=2000" /></p> <p><strong>Fix:</strong> Reduce unused rules from stylesheets and defer CSS not used for above-the-fold content. <a href="https://www.speedcurve.com/web-performance-guide/using-critical-css-for-faster-rendering/">Use critical CSS for faster rendering.</a>&nbsp;</p> <h2>Avoid 'document.write()'</h2> <p><strong>Metric(s) affected:</strong> Start Render and other downstream metrics</p> <p>For users on slow connections, external scripts dynamically injected via document.write() can delay page load by <em>tens</em> of seconds. That's a lot!</p> <p><img class="blog-img-md" src="https://blog-img.speedcurve.com/img/483/12-document-write.png?auto=format,compress&amp;fit=max&amp;w=2000" /></p> <p><strong>Fix:</strong> <a href="https://developer.chrome.com/blog/removing-document-write">Remove all uses of&nbsp;<code>document.write()</code>&nbsp;from your code.</a>&nbsp;If it's being used to inject third-party scripts, use asynchronous loading instead.</p> <h2>Eliminate render-blocking resources</h2> <p><strong>Metric(s) affected:</strong> Start Render, Largest Contentful Paint, and other downstream metrics</p> <p>A blocking resource is any resource that blocks the first paint of your page. Anything that has the potential to block your page completely is concerning, right? <strong>Yet&nbsp;3 out of 20 sites failed this audit</strong>.</p> <p><img class="blog-img-md" src="https://blog-img.speedcurve.com/img/483/13-eliminate-render-blocking-resources.png?auto=format,compress&amp;fit=max&amp;w=2000" /></p> <p><strong>Fix:</strong> <a href="https://developer.chrome.com/docs/lighthouse/performance/render-blocking-resources/">Eliminate render-blocking scripts.</a> Assess your blocking resources to make sure they're actually critical and then serve the legitimately critical scripts inline. Serve non-critical code asynchronously or defer it.&nbsp;Remove unused code completely.&nbsp;&nbsp;</p> <h2>Use HTTP/2</h2> <p>HTTP/2 offers many benefits over HTTP/1.1, including binary headers and multiplexing. What this means: your page's resources are leaner and faster.&nbsp;<strong>Most sites I looked at are already leveraging HTTP/2, but there were still a couple of holdouts.</strong></p> <p><img class="blog-img-md" src="https://blog-img.speedcurve.com/img/483/15-http2.png?auto=format,compress&amp;fit=max&amp;w=2000" /></p> <p><strong>Fix:</strong>&nbsp;<a href="https://dassur.ma/things/h2setup/">Learn how to set up HTTP/2.</a>&nbsp;</p> <h2>Do NOT lazy load the LCP image</h2> <p><strong>Metric(s) affected:</strong> Largest Contentful Paint</p> <p>Yikes! I don't see this issue often, but I'm still surprised every time I do. Images that are lazy loaded render later in the page lifecyle. Lazy loading is a great page speed optimization technique for non-critical images, such as those that are lower down on the page. But it's a huge problem if you're lazy loading your Largest Contentful Paint (LCP) image. This can add many seconds to your LCP time. (I've seen LCP times of up to 20 seconds &ndash; caused by lazy loading!)</p> <p>LCP is a Core Web Vital, which means it's a user experience signal in Google's search algorithm. The worse your LCP time, the greater risk of hurting your SEO rank. Just as important, slow images hurt the user experience, and ultimately conversions and bounce rate for your site. <strong>Seeing that 2 out of 20 sites failed this audit broke me a little.</strong> I hope this post helps you avoid this mistake!</p> <p><img class="blog-img-md" src="https://blog-img.speedcurve.com/img/483/14-lazy-load-lcp.png?auto=format,compress&amp;fit=max&amp;w=2000" /></p> <p><strong>Fix:</strong> The LCP image should&nbsp;<strong>never</strong>&nbsp;be lazy loaded. In fact, the LCP image should be prioritized to render as early in the page lifecycle as possible. If the LCP element is dynamically added to the page, you should preload the image. <a href="https://www.speedcurve.com/web-performance-guide/understanding-and-improving-largest-contentful-paint/">Get more LCP optimization tips.</a></p> <p>You should also <a href="https://www.speedcurve.com/web-performance-guide/complete-guide-performance-budgets/">create a performance budget</a> for LCP, so you get alerted right away if it suddenly degrades.&nbsp;</p> <h2>Why are so many recommendations neglected?</h2> <p>There are a few reasons I can think of off the top of my head:</p> <h3>Some optimizations may not affect the critical rendering path</h3> <p>The critical rendering path is the set of steps a browser takes to convert all a page's resources &ndash; from images and HTML to CSS and JavaScript &ndash; into a complete, functional web page. Optimizing the critical rendering path means taking a good look at the order in which the resources on your pages render, and then making sure that each resource in the rendering path is as performant as possible. It sounds simple &ndash; and conceptually it is &ndash; yet it can be tricky to achieve (as <a href="https://www.speedcurve.com/blog/web-performance-audit-lego/">this performance audit of LEGO.com</a> reveals).</p> <p>Depending on how a page is built, the critical rendering path might be well optimized, even disregarding some of the optimizations listed above. For example, a page might contain render-blocking first- and third-party JavaScript &ndash; such as ads and beacons &ndash; but if these scripts are called later in the pages rendering life cycle, then they probably won't affect the user experience.</p> <h3>Some optimizations may be harder (or impossible) to implement</h3> <p>If your page has a massive payload, there might not be much you can do about it. News sites, for example, typically have huge pages because they're required to contain a ton of ads and widgets in addition to their huge content payload of images and videos.</p> <p>And speaking of images, serving them in next-gen formats (e.g., AVIF instead of JPEG) can be challenging if you have a large number of content creators uploading images to your CMS.</p> <h3>People just don't know</h3> <p>Some practices &ndash; such as leveraging the bfcache &ndash; are so new that they might not be on people's radar. Others &ndash; such as knowing not to lazy load the LCP image &ndash; are probably because people are too broadly applying a generally good best practice like lazy loading.&nbsp;</p> <h2>But still...</h2> <p>Many of the sites I looked at are pretty fast, despite not following web performance optimization best practices religiously. But that doesn't mean ignoring best practices is... well, good practice.&nbsp;</p> <ul> <li><strong>Page size and complexity affects users at the 95th percentile</strong> &ndash; including mobile users and people using slower networks. Ignoring 5% (or more) of your users is a bad idea.</li> <li><strong>Bad practices pile up until there's a tipping point.</strong> After that, all it takes is one unoptimized image or non-performant script to seriously hurt your page.</li> <li><strong>Zombie third parties can introduce security issues.</strong> You should always understand why a third-party script is on your pages and eliminate the ones that don't belong there.</li> <li><strong>Page jank is a thing.</strong> It's not enough to have a fast Start Render or Largest Contentful Paint time. Your critical rendering path might be short and sweet, and your pages might start to render reasonably quickly, but what about the user experience during the entire rendering lifecycle of the page? Everyone hates jank, and too much of it hurts your UX and your business.</li> </ul> <h2>How to prioritize page speed optimizations</h2> <h3>1. Consider how many pages on your site are affected by each optimization recommendation</h3> <p>Run some <a href="https://www.speedcurve.com/web-performance-guide/synthetic-vs-real-user-monitoring/">synthetic</a> tests on your key pages and see which optimizations are recommended. If you're a SpeedCurve user, you can <a href="https://support.speedcurve.com/docs/aggregated-lighthouse-results">use your Improve dashboard to see how many pages on your site are affected by each audit</a>. If a large number of your pages would benefit from an optimization, then you may want to take the approach of tackling improvements one audit at a time.</p> <h3>2. Validate that an optimization will help your page and UX in a measurable way</h3> <p>You don't want to spend a lot of developer time implementing an optimization that won't ultimately benefit your users. Understanding the critical rendering path for your pages is the best way to know if optimizing a resource will make a difference in how the page feels from an end-user perspective.</p> <h3>3. Grab the easy fixes first</h3> <p>Sometimes it's easier to get yourself &ndash; and other folks &ndash; in your organization excited about performance fixes is to score some easy wins early on. Later, you can work your way up to the more time-consuming ones.</p> <p>Some easy(ish) recommendations:&nbsp;</p> <ul> <li>Tweaking your cache policy</li> <li>Enabling bfcache</li> <li>Setting height and width attributes on images</li> <li>Optimizing image and video sizes</li> <li>Serving third parties asynchronously or deferring them</li> </ul> <h2>Start somewhere and keep moving</h2> <p>If you've tested your pages and get a long list of recommended fixes, it can be a bit overwhelming &ndash; and more than a bit demoralizing. Start with the small, easy wins first. Speeding up your pages doesn't (usually) happen overnight. The important thing is to show up, do the work, and always be monitoring. Remember: you can't fix what you don't measure!</p> <p><a href="https://www.speedcurve.com/signup/"><img class="blog-img" src="https://blog-img.speedcurve.com/img/483/customer-logos-free-trial-banner.png?auto=format,compress&amp;fit=max&amp;w=2000" alt="" /></a></p> Tue, 09 Jul 2024 00:00:00 +1200 Performance Hero: Michelle Vu https://www.speedcurve.com/blog/performance-hero-michelle-vu <p><span class="large-para">Michelle Vu is one of the most knowledgeable, helpful, kind people you could ever hope to meet. As a founding member of Pinterest's performance team, she has created an incredibly strong culture of performance throughout Pinterest. She's also pioneered important custom metrics and practices, like Pinner Wait Time and performance budgets. We are super excited to share that Michelle is this month's Performance Hero!</span></p> <p><img class="blog-img" src="https://blog-img.speedcurve.com/img/512/michelle-vu.jpg?auto=format,compress&amp;fit=max&amp;w=2000" alt="" /></p> <div>Michelle is a web performance industry veteran who has spent the last seven years making Pinterest fast and reliable. She was a founding member of Pinterest's performance team, establishing foundations of their program by setting up its synthetic and real user metrics, proactive alerts, and performance analysis tools, while fostering a culture of performance across teams.</div> <div>&nbsp;</div><div>Michelle and her team at Pinterest pioneered the use of custom metrics when they introduced Pinner Wait Time (PWT). This metric measured the slowest loading time for content they considered critical for the user experience on a page.</div> <div>&nbsp;</div> <div>As the web performance tech lead at Pinterest, Michelle focuses on large optimizations to the Core Web Vital and Pinner Wait Time metrics for key features. She also aids in performance issues from platform migrations and product feature launches. When she's not working on optimizations, Michelle tackles performance regressions and develops tooling to analyze performance and prevent regressions.&nbsp;</div> <div>&nbsp;</div> <div>Michelle is a participant in the <a href="https://www.w3.org/webperf/">W3C Web Performance Working Group</a> as an Invited Expert. She's given talks about performance at Fastly's <a href="https://vimeo.com/267643422">Altitude NYC</a>, <a href="https://www.youtube.com/watch?v=FBeR6QvroEQ">performance.now()</a>, <a href="https://timkadlec.com/remembers/2018-03-27-notes-on-making-pinterest-fast-at-perfmatters/">PerfMatters</a>, and numerous web performance meetups.</div> <div>&nbsp;</div> <div>Most recently, Michelle presented on tooling to catch and prevent regressions due to increases in JavaScript bundle sizes. She's also in the midst of releasing a three-part series of articles &ndash; <a href="https://medium.com/pinterest-engineering/web-performance-regression-detection-part-1-of-3-86dcc6d5fce9">Web Performance Regression Detection</a>&nbsp;&ndash; on the Pinterest&nbsp;Engineering Blog.&nbsp;</div> <div>&nbsp;</div> <div><img class="blog-img" src="https://blog-img.speedcurve.com/img/512/perfmatters.jpg?auto=format,compress&amp;fit=max&amp;w=2000" alt="Michelle speaking at the Perfmatters conference in 2018" /></div> <div>&nbsp;</div> <div style="text-align: center;"><sup><em>Loved seeing Michelle use SpeedCurve visuals on stage to share how they help make Pinterest fast!</em></sup></div> <div>&nbsp;</div> <div><span style="color: #1f1f1f;">Here are a few ways you can find Michelle and learn more about the great work she does in our community:</span></div> <div> <ul> <li><a href="https://medium.com/@Pinterest_Engineering">Pinterest Engineering Blog</a></li> <li><a href="https://www.linkedin.com/in/michellethivu/">LinkedIn</a></li> <li><a href="https://x.com/micvu">Twitter</a></li> </ul> <p>Please join us in celebrating Michelle Vu, a true Performance Hero!</p> <p><em>Do you have someone you'd like to recognize as a Performance Hero?&nbsp;<a href="mailto:support@speedcurve.com">Let us know!</a></em></p> </div> Wed, 26 Jun 2024 00:00:00 +1200 New! Web Performance Guide https://www.speedcurve.com/blog/new-web-performance-guide <p><span style="font-size: 22px;">Our customers often tell us how much they appreciate the user-friendliness of the articles we create for them, so we recently decided to make them available to everyone (not just SpeedCurve users). Introducing the <a href="https://www.speedcurve.com/web-performance-guide/">Web Performance Guide</a>!</span></p> <p><img class="blog-img" src="https://blog-img.speedcurve.com/img/513/herman-bench-social.gif?auto=format,compress&amp;fit=max&amp;w=2000" alt="" /></p> <p>The <a href="https://www.speedcurve.com/web-performance-guide/" target="_blank" rel="noopener">Web Performance Guide</a> is &ndash; as its name suggests &ndash; a collection of articles we've been writing over the years to answer the most common questions we field about performance topics like site speed, why it matters, how it's measured, website monitoring tools, metrics, analytics,&nbsp;and optimization techniques.&nbsp;</p> <p>You'll find the articles grouped into these topics...</p><p><span style="font-size: 35px; color: #000000;">Business success</span></p> <p>Making your pages faster isn't just for the web performance geeks in your organization. Site speed affects every business metric you care about &ndash; from bounce rate to <a href="https://www.speedcurve.com/web-performance-guide/web-performance-for-retailers/">conversions</a> to <a href="https://www.speedcurve.com/web-performance-guide/seo-web-performance/">search rank</a>. This section gives you the data, tools, and tips to make everyone in your company care about&nbsp;<a href="/web-performance-guide/the-psychology-of-web-performance/">how page speed affects your users</a>&nbsp;and&nbsp;<a href="/web-performance-guide/performance-culture-best-practices/">build a healthy culture of web performance.</a></p> <h2>Core Web Vitals</h2> <p>There are a lot of metrics you need to track, and&nbsp;<a href="/web-performance-guide/get-started-with-core-web-vitals/">Core Web Vitals</a>&nbsp;are among them. These three metrics &ndash;&nbsp;<a href="/web-performance-guide/understanding-and-improving-largest-contentful-paint/">Largest Contentful Paint,</a>&nbsp;<a href="/web-performance-guide/understanding-and-improving-cumulative-layout-shift/">Cumulative Layout Shift,</a>&nbsp;and&nbsp;<a href="/web-performance-guide/understanding-and-improving-interaction-to-next-paint/">Interaction to Next Paint</a>&nbsp;&ndash; are important ingredients in Google's search ranking algorithm. We cover what they measure, how to track them over time (and get alerts when they degrade), and how to optimize your pages to improve them.</p> <h2>Optimization techniques</h2> <p><img class="blog-img-sm" style="float: right; margin: 20px;" src="https://blog-img.speedcurve.com/img/510/sad-mobile.png?auto=format,compress&amp;fit=max&amp;w=2000" alt="" /></p> <p>Website speed testing is just the first step toward optimizing your pages to make them faster &ndash; and make your users happier. This section covers best practices for creating&nbsp;<a href="/web-performance-guide/complete-guide-performance-budgets/">performance budgets</a>&nbsp;to fight regressions, as well as techniques for optimizing&nbsp;<a href="/web-performance-guide/best-practices-for-optimizing-images/">images,</a>&nbsp;<a href="/web-performance-guide/best-practices-for-optimizing-javascript/">JavaScript,</a>&nbsp;<a href="/web-performance-guide/using-critical-css-for-faster-rendering/">CSS,</a>&nbsp;<a href="/web-performance-guide/optimizing-single-page-applications-spas/">SPAs,</a>&nbsp;<a href="/web-performance-guide/third-party-web-performance/">third-party scripts</a>, and more!</p> <h2>Metrics and charts</h2> <p>There's a lot of terminology and TLAs (three-letter acronyms) in the web performance space. No fear! We're here to explain everything in&nbsp;<a href="/web-performance-guide/how-to-trust-your-metrics/">plain language</a>&nbsp;so you can understand what you're seeing in your site speed testing tools. We'll help you understand the difference between <a href="https://www.speedcurve.com/web-performance-guide/synthetic-vs-real-user-monitoring/">synthetic and real user monitoring</a> tools. We also cover topics like <a href="https://www.speedcurve.com/web-performance-guide/averages-medians-percentiles/">understanding averages, medians and percentiles</a> and how to interpret charts like <a href="https://www.speedcurve.com/web-performance-guide/how-to-read-a-rum-histogram/">histograms</a> and waterfalls.</p> <h2>Everything in the Web Performance Guide was written by actual humans!</h2> <p>Meet our&nbsp;<a href="https://www.speedcurve.com/about/">amazing team</a>&nbsp;of web performance experts and authors:</p> <ul> <li>Cliff Crocker</li> <li>Andy Davies</li> <li>Tammy Everts</li> <li>Tim Kadlec</li> <li>Steve Souders</li> <li>Joseph Wynn</li> <li>Mark Zeman</li> </ul> <p>Not only do they deliver&nbsp;<a href="https://www.speedcurve.com/features/consulting/">world-class consulting</a>&nbsp;and hands-on care to our&nbsp;<a href="https://www.speedcurve.com/customers/">wonderful customers</a>, they're pretty great writers, too!</p> <h2>Questions? Suggestions?</h2> <p>We'd love to hear from you! Drop us a note at support@speedcurve.com.</p> <p><a href="https://www.speedcurve.com/signup/"><img class="blog-img" src="https://blog-img.speedcurve.com/img/513/customer-logos-free-trial-banner.png?auto=format,compress&amp;fit=max&amp;w=2000" alt="" /></a></p> Tue, 25 Jun 2024 00:00:00 +1200 Performance Hero: Estela Franco https://www.speedcurve.com/blog/web-performance-hero-estela-franco <p><span class="large-para">Continuing our series of Performance Heroes, this month we celebrate&nbsp;Estela Franco! Estela is a passionate web performance and technical SEO specialist with more than ten years of contributing to our community. She loves to talk and share about web performance optimization, technical SEO, JavaScript, and Jamstack whenever she can.</span></p> <p><img class="blog-img" src="https://blog-img.speedcurve.com/img/486/perf-hero-estela-franco-main1.png?auto=format,compress&amp;fit=max&amp;w=2000" alt="" /></p><p>By day, you can find Estela working as a web performance specialist for Schneider Electric in Barcelona, Spain. Outside of work, her contributions as a Google Developer Expert in Web Technologies, a Storyblok Ambassador, co-organizer of the <a href="https://www.meetup.com/barcelona-web-performance/">Barcelona Web Performance Meetup</a>, and co-founder of the <a href="https://www.mujeresenseo.es/">Mujeres en SEO</a> community have made a huge impact on developers and web performance aficionados around the globe.</p> <p>Estela has the winning combination of a web development background coupled with a background in business administration. She started on the marketing side, discovering the fundamentals of SEO and digging deeper into the code to learn how websites work and how to optimize for both robots and humans. This led her to specialize in technical SEO. With the announcement of the Core Web Vitals back in 2020, Estela made the decision to focus on web performance.</p> <p>In&nbsp;<a href="https://youtu.be/ZYX6jXGdlyg">her talk at Performance.now</a>&nbsp;in November 2023, Estela helped demystify optimizing for Largest Contentful Paint (LCP) with a focus on LCP subparts. Her data-backed approach was refreshing, practical, and very useful. (We certainly took note!)</p> <p>Here are a few ways you can find Estela and learn more about the great work she does in our community:</p> <ul> <li><a href="https://estelafranco.com">estelafranco.com</a></li> <li><a href="https://www.linkedin.com/in/estelafranco/">LinkedIn</a></li> <li><a href="https://toot.cafe/@guaca">Mastodon</a></li> <li><a href="https://twitter.com/guaca">Twitter</a></li> </ul> <p><span style="color: #1f1f1f;">Please join us in celebrating Estela Franco, a true Performance Hero!</span></p> <p><em>Do you have someone you'd like to recognize as a Performance Hero?&nbsp;<a href="mailto:support@speedcurve.com">Let us know!</a></em></p> Tue, 21 May 2024 00:00:00 +1200 NEW: RUM attribution and subparts for Interaction to Next Paint! https://www.speedcurve.com/blog/rum-attribution-subparts-interaction-to-next-paint <p><span class="large-para">Now it's even easier to find and fix Interaction to Next Paint issues and improve your Core Web Vitals.</span></p> <p><img class="blog-img" src="https://blog-img.speedcurve.com/img/485/inp_heatmap.gif?auto=format,compress&amp;fit=max&amp;w=2000" alt="Heatmap table showing INP selector performance sorted by page views" /></p> <p>Our newest release continues our theme of making your RUM data even more actionable. In addition to&nbsp;<a href="https://www.speedcurve.com/blog/bfcache-prerendering/">advanced settings, navigation types, and page attributes</a>, we've just released more diagnostic detail for the latest flavor in Core Web Vitals: Interaction to Next Paint (INP).</p> <p>This post covers:</p> <ul> <li>Element attribution for INP&nbsp;</li> <li>A breakdown of where time is spent within INP, leveraging subparts</li> <li>How to use this information to find and fix INP issues</li> <li>A look ahead at RUM diagnostics at SpeedCurve</li> </ul><h2>How quickly does my site respond to user input?</h2> <p>In short, Interaction to Next Paint measures the responsiveness of your pages. (If you want to dive deeper, check out our <a href="https://www.speedcurve.com/blog/check-core-web-vitals-inp/">INP primer</a>.)&nbsp;Delays in responsiveness can lead to user frustration, which affects user engagement, which in turn affects your business objectives, such as revenue. This is why you should care about INP.</p> <p><img class="blog-img" src="https://blog-img.speedcurve.com/img/449/inp_v_conversion.gif?auto=format,compress&amp;fit=max&amp;w=2000" alt="Correlation charts showing the relationship between INP and conversion rates for four different sites." /></p> <p style="text-align: center;"><em>Correlation charts showing <a href="https://www.speedcurve.com/blog/INP-user-experience-correlation/">how INP affects user engagement</a></em></p> <h2>Element attribution</h2> <p>We've been collecting Interaction to Next Paint data for a while. Early on, we found that poor INP was an issue for a lot of folks, <a href="https://www.speedcurve.com/blog/core-web-vitals-inp-mobile/">especially when looking at mobile users</a>.</p> <p>However, as a general time-based metric, INP didn't leave a lot of hints as to the source of the problem. Our early solutions leveraged our <a href="https://www.speedcurve.com/blog/interaction-to-next-paint-find-ix-elements/">IX elements as a proxy for element attribution</a> for INP. <strong>This is still a viable option for all non-Chromium browsers &ndash; which, to be clear, is probably more than half of your traffic!</strong> However, with the element selector directly attributed to INP for Chromium browsers, you are provided <strong>a lot</strong> of missing context.</p> <p>After a bit of research and plenty of consultation with our customers, we've decided to expose the INP element selector. In addition, we've improved our classification for IX elements, making it easier to cross reference attribution with non-Chromium browsers.</p> <p><img class="blog-img" src="https://blog-img.speedcurve.com/img/485/inp_heatmap_element.gif?auto=format,compress&amp;fit=max&amp;w=2000" alt="INP heat map highlighting element selector column" /></p> <p style="text-align: center;"><em>INP heatmap available in your RUM Performance dashboard&nbsp;</em></p> <h2>INP subparts</h2> <p>After identifying which interactions are responsible for Interaction to Next Paint issues, you'll want to understand where that time is being spent. This is provided with INP subparts, which are now collected for all SpeedCurve RUM users.</p> <p>There are three main areas to look at when diagnosing INP times:</p> <ul> <li>Input delay</li> <li>Processing time</li> <li>Presentation delay</li> </ul> <p style="text-align: center;"><img class="blog-img" src="https://blog-img.speedcurve.com/img/485/webdev_inp_illustration.gif?auto=format,compress&amp;fit=max&amp;w=2000" alt="Diagram showing a user interaction and subpart timings" /></p> <p style="text-align: center;"><em>Source: <a href="https://web.dev/articles/inp#what's-in-an-interaction">INP: What's in an interaction?</a></em></p> <h3>Input delay</h3> <p>As you can see in the illustration above, input delay measures from the time that the user interaction started (when the input was received) until the event handler is able to run.&nbsp;</p> <h3>Processing time</h3> <p>Processing time includes the time it takes event callbacks, initiated by the interaction, to complete.</p> <h3>Presentation Delay</h3> <p>Simply put, presentation delay is the time it takes the frame to be presented after the event callbacks are completed.</p> <h2>Using SpeedCurve RUM to find and fix INP issues</h2> <p>Once you've identified that Interaction to Next Paint is an issue for your page (or pages), you can use the heatmap shown above in your RUM Performance dashboard to identify problematic elements on your page.</p> <h3>Step 1: Make sure you've set the RUM Performance dashboard filter to the 75th percentile</h3> <p>This is especially important if you are chasing INP issues you've identified via CrUX or Google Search Console.</p> <p><img class="blog-img-md" src="https://blog-img.speedcurve.com/img/485/filterp75.gif?auto=format,compress&amp;fit=max&amp;w=2000" alt="Dashboard filter showing 75th percentile selected" /></p> <h3>Step 2: Navigate to the INP heatmap</h3> <p>Look for thresholds that have been exceeded, using the color-based Google-defined thresholds for INP:</p> <ul> <li>Green = &lt;200ms</li> <li>Yellow = 200-500ms</li> <li>Red = &gt;500ms</li> </ul> <p><img class="blog-img" src="https://blog-img.speedcurve.com/img/485/inptablep75.gif?auto=format,compress&amp;fit=max&amp;w=2000" alt="INP heatmap showing several poor INP element selectors" /></p> <h3>Step 3:&nbsp;Determine where the most time is spent</h3> <p>Below are a few examples to go along with this Web.dev post on <a href="https://web.dev/articles/optimize-inp">Optimizing INP</a> by Jeremy Wagner and Philip Walton.</p> <p><strong>Input delay</strong></p> <p><strong><img class="blog-img" src="https://blog-img.speedcurve.com/img/485/inputdelayheatmap.gif?auto=format,compress&amp;fit=max&amp;w=2000" alt="Slow INP element showing a large amount of time in input delay" /></strong></p> <p>Factors that affect input delay&nbsp;<em>generally</em>&nbsp;include contending main thread work. Look for Long Tasks that appear to be in conflict with the interaction, fetch handlers, timer functions, or other competing interactions.</p> <p><strong>Processing delay</strong></p> <p><strong><img class="blog-img" src="https://blog-img.speedcurve.com/img/485/processingdelayheatmap.gif?auto=format,compress&amp;fit=max&amp;w=2000" alt="Slow INP with high processing time" /></strong></p> <p>If time is spent here, look at optimizing event callbacks. As with Long Tasks, breaking things up into smaller chunks of work and deferring work not required for rendering is recommended.</p> <p><strong>Presentation delay</strong></p> <p><img class="blog-img" src="https://blog-img.speedcurve.com/img/485/presentationdelayheatmap.gif?auto=format,compress&amp;fit=max&amp;w=2000" alt="Slow INP with long running presentation delay highlighted" /></p> <p>Issues with presentation delay are typically related to the complexity of the DOM. Other improvements to presentation delay may come by reducing the amount of client-side rendering required and deferring rendering of off-screen elements.</p> <p>For a deeper dive into troubleshooting INP issues, see <a href="https://www.speedcurve.com/blog/debugging-interaction-to-next-paint-inp/">this post by Andy Davies</a> which takes you through using Chrome DevTools to profile interactions.&nbsp;</p> <h2>What about iOS?</h2> <p>The lack of support for web performance metrics in Safari is not a new complaint, but it's a big one. Developers are left to their own devices to troubleshoot performance on iOS devices. While Apple hasn't announced any plans to support any of the Core Web Vitals soon, there is some ability to triangulate on potential issues that might affect the user experience.</p> <p>As an example, the <strong>Interaction Metrics (IX) captured by SpeedCurve are available for Safari</strong>. With the latest upgrades to RUM, we've made it easier to identify those IX elements, which tend to align very closely with the INP element selectors we see for Chromium. This guide to <a href="https://www.speedcurve.com/blog/interaction-to-next-paint-find-ix-elements/">finding and fixing INP issues</a>&nbsp;using IX elements as a proxy still applies!</p> <h2>Looking ahead at RUM diagnostics</h2> <p>Team SpeedCurve is very excited! Here's what we'll be up to over the coming months:</p> <ul> <li>We'll be making a lot of updates and improvements to our data pipeline, which will allow us to continue our mission of making RUM even more actionable.</li> <li>We'll be focused on improving the diagnostic capabilities for the remaining Core Web Vitals, Largest Contentful Paint (LCP) and Cumulative Layout Shift (CLS).</li> <li>We'll also be focused on enhanced support for the increasing complexity of measuring the entire lifecycle of the page.</li> </ul> <p>We're excited to roll out this update for Interaction to Next Paint and hope you get a lot of use from it. As always, we value your feedback, so <a href="mailto:support@speedcurve.com">shoot us a note</a> and let us know what you think!<br /><br /></p> <p><a href="https://www.speedcurve.com/signup/"><img class="blog-img" src="https://blog-img.speedcurve.com/img/485/customer-logos-free-trial-banner.png?auto=format,compress&amp;fit=max&amp;w=2000" alt="" /></a></p> Wed, 01 May 2024 00:00:00 +1200 Performance Hero: Paul Calvano https://www.speedcurve.com/blog/web-performance-hero-paul-calvano <p><span class="large-para">Celebrating performance wins is critical to a healthy, well-supported, high-performing team. This isn't a new idea. In fact, it's something that started in the early days of web performance when <a href="https://larahogan.me/">Lara Hogan</a>, who was an engineering manager at Etsy at the time, discussed the <a href="https://designingforperformance.com/changing-culture/#empowering">practice of empowering people</a>&nbsp;across the organization by celebrating 'performance heroes'.</span></p> <p><strong><img class="blog-img" src="https://blog-img.speedcurve.com/img/468/perf-hero-paul-calvano-hero.png?auto=format,compress&amp;fit=max&amp;w=2000" alt="" /></strong></p> <p style="color: #1f1f1f; font-family: Gotham, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">&nbsp;</p> <p style="color: #1f1f1f; font-family: Gotham, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">In that spirit, we're reigniting the tradition of spotlighting Performance Heroes from our awesome community. It seems appropriate that we'd start with someone who is currently focused on keeping Etsy's site as fast as possible:&nbsp;<strong>Paul Calvano</strong></p> <p>Not only has Paul had a long career dedicated to making the web faster for some of the largest and most popular sites in the world, he is humble, incredibly talented, and one of the kindest people you'll ever meet.</p><p>I've known Paul since I got started in web performance, back in the days of load and performance testing at Keynote Systems (now part of Dynatrace). Paul took me under his wing and quickly showed me the art of breaking websites to prepare them for large influxes of traffic like Black Friday.</p> <p>Paul recently spoke about font performance at the <a href="https://www.meetup.com/web-performance-ny/">NY WebPerf Meetup Group</a>, which he co-chairs. Sharing insights from Etsy and how they use&nbsp;<a href="https://www.speedcurve.com/blog/performance-budgets/">performance budgets</a> continues the spirit of transparency and accountability that started at Etsy so many years ago.</p> <p><img class="blog-img" src="https://blog-img.speedcurve.com/img/468/perfbudgetfonts.png?auto=format,compress&amp;fit=max&amp;w=2000" alt="Graph showing a performance budget for fonts being exceeded" /><br />Paul's list of accomplishments include (but are certainly not limited to):</p> <ul> <li>Speaking at multiple conferences</li> <li>Co-chair of the <a href="https://www.meetup.com/web-performance-ny/">New York UX Speed and Web Performance Meetup</a></li> <li>Co-maintainer of the&nbsp;<a href="https://httparchive.org/">HTTP Archive</a></li> <li>Multi-year contributor to the Web Performance Almanac</li> <li>Author of <a href="https://paulcalvano.com/tools/">many tools</a> aimed at helping people optimize their websites</li> </ul> <p>Paul is one of the most intelligent and humble people I know. He's given a lot to our community and continues to evangelize performance at every turn. Thank you for everything you've done for our community, Paul. It wouldn't be the same without you!</p> <p><em>Do you have someone you'd like to recognize as a Performance Hero? <a href="mailto:support@speedcurve.com">Let us know!</a></em></p> <p>&nbsp;</p> <p><a href="https://www.speedcurve.com/signup/"><em><img class="blog-img" src="https://blog-img.speedcurve.com/img/468/customer-logos-free-trial-banner.png?auto=format,compress&amp;fit=max&amp;w=2000" alt="" /></em></a></p> Tue, 23 Apr 2024 00:00:00 +1200 Five ways cookie consent managers hurt web performance (and how to fix them) https://www.speedcurve.com/blog/web-performance-cookie-consent <p><span class="large-para">Cookie consent popups and banners are everywhere, and they're silently hurting the speed of your pages. Learn the most common problems &ndash; and their workarounds &ndash; with measuring performance with content manager platforms in place.</span></p> <p><img class="blog-img" src="https://blog-img.speedcurve.com/img/481/cookie-consent.gif?auto=format,compress&amp;fit=max&amp;w=2000" alt="" /></p> <p>I've been spending a lot of time looking at the performance of European sites lately, and have found that the consent management platforms (CMPs) consistently create a false reality for folks when trying to understand performance using synthetic monitoring. Admittedly, this is not a new topic, but I feel it's important enough that it warrants another PSA.&nbsp;</p> <p>In this post, I will cover some of the issues related to measuring performance with CMPs in place and provide some resources for scripting around consent popups in SpeedCurve.</p><h2>What are CMPs and how do they work?</h2> <p>A consent management platform (CMP) is a tool that helps organizations handle user consent for data collection and processing, following privacy rules like <a href="https://gdpr-info.eu/">GDPR</a> or <a href="https://oag.ca.gov/privacy/ccpa">CCPA</a>. On websites, CMPs handle cookie popups. They tell users about cookies and ask for permission before saving them. Unless you've been abstaining from the internet for the past several years, you know consent managers well.</p> <h2>What challenges do CMPs create for performance?</h2> <p>These are some of the most common performance issues caused by content management platforms.</p> <h3>1. Single Point of Failure (SPOF)</h3> <p>As a third party, CMPs can have performance issues of their own that can affect the user experience. It's common to see the consent scripts blocking by design. This can have an impact on most metrics &ndash; such as Start Render and Largest Contentful Paint &ndash; downstream.</p> <p><img class="blog-img" src="https://blog-img.speedcurve.com/img/481/spoffilmstrip.gif?auto=format,compress&amp;fit=max&amp;w=2000" alt="Two filmstrips compared to show a long delay on the second due to a single point of failure from the CMP." /></p> <p>In this example, the synchronous requests for the CMP timed out, causing an extremely long delay in Start Render due to the SPOF. Consent scripts&nbsp;<a href="https://web.dev/articles/cookie-notice-best-practices#load_cookie_notices_scripts_asynchronously">should be loaded async</a>&nbsp;whenever possible.</p> <h3>2. Identifying the wrong LCP element</h3> <p>Most people assume the LCP element on a page is their main hero or product image, but they're frequently wrong. Oftentimes the text or element in the consent popup is identified as the LCP element. While this may be technically accurate, it's probably not what you want to measure.&nbsp;</p> <p>In this case, LCP is slower after opt-in, when the hero image has taken 2.5s longer to load.</p> <p><img class="blog-img" src="https://blog-img.speedcurve.com/img/481/lcp-compare.gif?auto=format,compress&amp;fit=max&amp;w=2000" alt="Comparison of two rendered images. The first shows LCP as the text in the consent popup while the 2nd shows a hero image which has taken longer to load" /></p> <h3>3. Consent banners can hurt Cumulative Layout Shift scores</h3> <p>Some sites choose to use a consent banner instead of a popup. As <a href="https://andydavies.me/blog/2021/03/25/bypassing-cookie-consent-banners-in-lighthouse-and-webpagetest/">Andy Davies discovered</a>, this can sometimes cause CLS issues, depending on how the banner is implemented. In this example, the consent banner causes a large layout shift for first-time viewers, pushing the CLS score well beyond recommended <a href="https://support.speedcurve.com/docs/get-started-with-core-web-vitals">Core Web Vitals thresholds</a>.</p> <p><img class="blog-img" src="https://blog-img.speedcurve.com/img/481/cls.gif?auto=format,compress&amp;fit=max&amp;w=2000" alt="Two frames showing a large layout shift due to the consent banner." /></p> <p><a href="https://sia.codes/">Sia Karamalegos</a> from Shopify provided <a href="https://performance.shopify.com/blogs/blog/how-to-optimize-cumulative-layout-shift-cls-on-shopify-sites#4.-optimize-your-animations">another great example</a> of how cookie notices that are animating position properties vs. using the preferred method of CSS transform can cause massive CLS scores. (<strong>Side note:</strong> This post is a great read for anyone looking to optimize for CLS their Shopify site)</p> <h3>4. Masking third-party performance</h3> <p>Assuming that you have visibility into your third-party performance is another pitfall when testing the first view of a site synthetically. For some site owners, the difference between the initial experience and an an opted-in experience can be extreme due to the presence of third-party JavaScript.</p> <p><img class="blog-img" src="https://blog-img.speedcurve.com/img/481/compare_phahn.gif?auto=format,compress&amp;fit=max&amp;w=2000" alt="Comparison of Peter Hahn homepage with and without opt-in consent" /></p> <p>If you were just looking at metrics, the event timeline comparison below may be a bit of a head-scratcher. LCP is deceptively slower in the first view, due to the late render of the consent popup, whose text block is identified as the LCP element. Meanwhile, Time to Interactive (TTI) is much faster. If you look at the highlighted activity timeline, it's apparent that the third-party JavaScript for the opted-in experience creates a lot of additional CPU activity and Long Tasks.</p> <p><img class="blog-img" src="https://blog-img.speedcurve.com/img/481/timelinecompare.gif?auto=format,compress&amp;fit=max&amp;w=2000" alt="Comparison of event timeline between opted-in and first view" /></p> <p>The opted-in experience also loads an additional 73 third-party requests!</p> <p><img class="blog-img" src="https://blog-img.speedcurve.com/img/481/uniquethirdpartyrequests.gif?auto=format,compress&amp;fit=max&amp;w=2000" alt="List comparing unique third-party requests " /></p> <h3>5. Interaction to Next Paint (INP) and cookie consent</h3> <p>In his <a href="https://www.speedcurve.com/blog/debugging-interaction-to-next-paint-inp/">latest blog post on debugging INP</a>, Andy Davies provides an example (#3) of how the interaction of accepting the consent dialog causes high processing time. This is due to the functions called from the Event Handler. Given the <a href="https://www.speedcurve.com/blog/check-core-web-vitals-inp/">recent announcement</a> that INP has replaced First Input Delay as a Core Web Vital, this is certainly something to look out for.&nbsp;</p> <p><img class="blog-img" src="https://blog-img.speedcurve.com/img/481/consentinp.gif?auto=format,compress&amp;fit=max&amp;w=2000" alt="Flame chart showing high interaction to next paint due to processing time" /></p> <h2>How do I bypass the CMP?</h2> <p>Testing an opted-in experience is highly recommended. This is possible by setting the correct cookie values or in some cases localStorage entries.</p> <p>If you're a SpeedCurve user, we've created a <a href="https://support.speedcurve.com/docs/scripting-cookie-consents">Scripting Cookie Consents Guide</a> with scripting examples for some of the more common CMPs. This includes LiveRamp, OneTrust, Quantcast Choice, TrustArc and Usercentrics.&nbsp;</p> <p>If possible, you should test both experiences &ndash; pre- and post-opt-in &ndash; and treat them as the unique experiences they are.</p> <h2>It's been said before...</h2> <p><a href="https://twitter.com/katiehempenius">Katie Hempenius</a>, <a href="https://twitter.com/simonhearne?lang=en">Simon Hearne</a>,&nbsp;<a href="https://sia.codes/">Sia Karamalegos</a>, <a href="https://twitter.com/AndyDavies">Andy Davies</a> and others have done deep dives into this topic. I've learned a ton from them, and frankly repeated a lot of what they said. Again, this is a PSA that warrants over-communication! ;)</p> <p>Here are some must-reads by these fine folks:</p> <ul> <li><a href="https://web.dev/articles/cookie-notice-best-practices">Best practices for cookie notices</a></li> <li><a href="https://simonhearne.com/2020/testing-behind-consent/">Measuring Performance Behind Consent Popups</a></li> <li><a href="https://andydavies.me/blog/2021/03/25/bypassing-cookie-consent-banners-in-lighthouse-and-webpagetest/">Bypassing Cookie Consent Banners in Lighthouse and WebPageTest</a></li> <li><a href="https://www.speedcurve.com/blog/element-timing-one-true-metric/">Element Timing: One true metric to rule them all?</a></li> <li><a href="https://www.speedcurve.com/blog/debugging-interaction-to-next-paint-inp/">Debugging Interaction to Next Paint</a></li> <li><a href="https://performance.shopify.com/blogs/blog/how-to-optimize-cumulative-layout-shift-cls-on-shopify-sites">Optimizing CLS for Shopify sites</a></li> </ul> <p>&nbsp;</p> <p><a href="https://www.speedcurve.com/signup/"><img class="blog-img" src="https://blog-img.speedcurve.com/img/481/customer-logos-free-trial-banner.png?auto=format,compress&amp;fit=max&amp;w=2000" alt="" /></a></p> Mon, 15 Apr 2024 00:00:00 +1200