<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Felix Gessert</title>
    <description>The latest articles on DEV Community by Felix Gessert (@felix_gessert_3ffe30dd6fc).</description>
    <link>https://dev.to/felix_gessert_3ffe30dd6fc</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F573671%2F1dfe80ae-7290-4c98-9f1c-2f9495953a09.png</url>
      <title>DEV Community: Felix Gessert</title>
      <link>https://dev.to/felix_gessert_3ffe30dd6fc</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/felix_gessert_3ffe30dd6fc"/>
    <language>en</language>
    <item>
      <title>The Core Web Vital “Largest Contentful Paint” just changed dramatically</title>
      <dc:creator>Felix Gessert</dc:creator>
      <pubDate>Thu, 04 Feb 2021 18:35:47 +0000</pubDate>
      <link>https://dev.to/baqend/the-core-web-vital-largest-contentful-paint-just-changed-dramatically-39k9</link>
      <guid>https://dev.to/baqend/the-core-web-vital-largest-contentful-paint-just-changed-dramatically-39k9</guid>
      <description>&lt;p&gt;In this quick summary we present a finding around the central Google Core Web Vital Largest Contentful Paint (LCP) that is expected to change in a drastic way with the recent release of Chrome 88. Overall, we found that the LCP is likely to drop by as much as 20%. Given Google’s upcoming ranking changes for May 2021, the LCP is more important than ever.&lt;/p&gt;

&lt;h3&gt;
  
  
  Background: What are the Core Web Vitals?
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="https://web.dev/vitals/#core-web-vitals" rel="noopener noreferrer"&gt;Core Web Vitals&lt;/a&gt; are an initiative by Google, to provide better metrics to evaluate page performance and user experience. While previously it had already been possible to somehow capture the “felt page speed” of websites using metrics such as the Speed Index (the average time to visibility of page elements) pioneered by WebPagetest or the First Meaningful Paint (the time of the biggest visual change in page rendering), these methods had one severe problem: they rely on a synthetic testing environment and video analysis. So, they cannot be measured through browser APIs and with actual “field data”. Previous metrics that were available from the browser and navigation timing APIs like the time-to-first-byte and the first paint on the other hand do not fully reflect the real &lt;em&gt;experience of speed&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Google introduced three core web vitals: the &lt;strong&gt;Largest Contentful Paint&lt;/strong&gt; (LCP), the &lt;strong&gt;First Input Delay&lt;/strong&gt; (FID) and the *&lt;em&gt;Cumulative Layout Shift *&lt;/em&gt;(CLS). For each of these metrics, Google also proposes a “traffic light” essentially putting page views into three buckets &lt;em&gt;good&lt;/em&gt;, &lt;em&gt;ok&lt;/em&gt;, &lt;em&gt;bad&lt;/em&gt; based on thresholds.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2704%2F1%2A3foVCyiTopFghZYehDVodg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2704%2F1%2A3foVCyiTopFghZYehDVodg.png" alt="The three Core Web Vitals (image taken from [web.dev](https://web.dev/vitals/#core-web-vitals))."&gt;&lt;/a&gt;&lt;em&gt;The three Core Web Vitals (image taken from &lt;a href="https://web.dev/vitals/#core-web-vitals" rel="noopener noreferrer"&gt;web.dev&lt;/a&gt;).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This is what the Core Web Vitals capture:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;LCP&lt;/strong&gt;: measures &lt;strong&gt;how fast the page loads&lt;/strong&gt;. For this, it captures the moment during the rendering process where the largest element containing content (e.g. text of images) is rendering on the user’s screen.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;FID&lt;/strong&gt;: measures &lt;strong&gt;how quickly the page responds to user interaction&lt;/strong&gt;. It is evaluated as the time between the first interaction (e.g. click or screen tap) until the event is processed in a JavaScript handler.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;CLS&lt;/strong&gt;: measures &lt;strong&gt;how stable the page is rendering&lt;/strong&gt;. The calculation is a bit complicated but evolves around how much content is jumping/moving by what distance during the rendering process. There are &lt;a href="https://web.dev/better-layout-shift-metric/" rel="noopener noreferrer"&gt;ongoing discussions&lt;/a&gt; on how to optimize the calculation to best reflect user-felt “annoyingness”.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Naturally, many consider the LCP as the central metric as it reflects the overall loading time of a page. Currently, the Largest Contentful Paint API is &lt;a href="https://caniuse.com/?search=largest" rel="noopener noreferrer"&gt;available&lt;/a&gt; in Chromium-based browsers, so covering around 70% of end users. In a second, we will explain why many websites might have scored badly in the LCP without actually doing anything wrong or being slow.&lt;/p&gt;

&lt;h3&gt;
  
  
  Measuring the Web Vitals
&lt;/h3&gt;

&lt;p&gt;Today the main sources for the Web Vitals are &lt;a href="https://developers.google.com/web/tools/lighthouse" rel="noopener noreferrer"&gt;Lighthouse&lt;/a&gt; respectively &lt;a href="https://developers.google.com/speed/pagespeed/insights/?hl=de" rel="noopener noreferrer"&gt;Page Speed Insights&lt;/a&gt; for synthetic (“bot”) performance measurements as well as the &lt;a href="https://developers.google.com/web/tools/chrome-user-experience-report" rel="noopener noreferrer"&gt;Chrome User Experience Report &lt;/a&gt;(CRUX). CRUX is a highly valuable public data set that contains anonymous real-user performance data from Chrome browsers for Millions of top domains. It is not only a great tool for performance analysis but also the basis for Google incorporating end-user speed as a ranking factor into its search.&lt;/p&gt;

&lt;p&gt;For example, one interesting thing you can do is to rank the top 10 global e-commerce companies by their LCP:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F3008%2F1%2AwVcFIccOcdL3CFen-fQOJg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F3008%2F1%2AwVcFIccOcdL3CFen-fQOJg.png" alt="Ranking of top 10 e-commerce players (by revenue) ordered by share of fast LCP page views (source: Pagespeed Insights CRUX data as of Feb 4 2021)"&gt;&lt;/a&gt;&lt;em&gt;Ranking of top 10 e-commerce players (by revenue) ordered by share of fast LCP page views (source: Pagespeed Insights CRUX data as of Feb 4 2021)&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Google Page Experience Update is around the corner
&lt;/h3&gt;

&lt;p&gt;The web vitals were presented in May 2020. By the end of last year, Google announced that starting from May 2021 the Web Vitals will become part of the Google Search ranking. Since its &lt;a href="https://webmasters.googleblog.com/2018/01/using-page-speed-in-mobile-search.html" rel="noopener noreferrer"&gt;Mobile Speed Update&lt;/a&gt; from 2018, Google has been considering speed in the rank and — unlike in the old days — speed is no longer measured by the Google bot but instead &lt;a href="https://moz.com/blog/google-chrome-usage-data-measure-site-speed" rel="noopener noreferrer"&gt;based on CRUX&lt;/a&gt;. Besides the organic ranking, speed also plays a &lt;a href="https://developers.google.com/web/updates/2018/07/search-ads-speed" rel="noopener noreferrer"&gt;role for SEA/ad placement&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;While the quantitative impact of speed on SEO is of course a well-kept secret, there are some studies. For example, Pinterest has seen &lt;a href="https://medium.com/pinterest-engineering/driving-user-growth-with-performance-improvements-cfc50dafadd7#.wwimdmkpp" rel="noopener noreferrer"&gt;an additional 15% organic search engine traffic&lt;/a&gt; after improving page speed by 40%.&lt;/p&gt;

&lt;p&gt;If even before the web vitals update speed has already played such a crucial role, it is very likely to become a lot more important. Many of our e-commerce customers at Baqend for example have recently invested into getting as fast a possible in the LCP before the May update comes.&lt;/p&gt;

&lt;h3&gt;
  
  
  The finding: for JavaScript-heavy websites the LCP was not accurate
&lt;/h3&gt;

&lt;p&gt;Since a while we noticed, that the LCP seemed to be unreasonably high on some sites that relied heavily on JavaScript for client-side rendering. We then noted that a change to the LCP was launching for Chrome 88 that potentially changes a lot.&lt;/p&gt;

&lt;p&gt;Essentially, what we observed was this: when the element that makes up the LCP is changed by JavaScript in the DOM, the LCP is reset even if the page is visually not changing at all. For example, as on &lt;a href="https://testpage.app.baqend.com/" rel="noopener noreferrer"&gt;this test page&lt;/a&gt;, if we change the hero image after 3 seconds, the LCP will be reset and reported to be more than 3 seconds, even though nothing has changed!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F3442%2F0%2AsEDwOzxkGlzCI4CY" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F3442%2F0%2AsEDwOzxkGlzCI4CY"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Why is this important?
&lt;/h3&gt;

&lt;p&gt;The problem is that many websites rely on client-side JavaScript to modify elements that are defining the LCP. For example, if you change a product image slider in a shop during rendering, you can display the image as early as you want, the LCP will still be bad.&lt;/p&gt;

&lt;p&gt;The issue is even more systematic for websites relying on modern frontend frameworks such as React, Angular, Svelte, and Vue: as soon as server-side rendering is used (usually for performance reasons!) the client-side rehydration is changing the DOM and resetting the LCP. Rehydration is simply the process of “booting up JavaScript views on the client such that they reuse the server-rendered HTML’s DOM tree and data” (see &lt;a href="https://developers.google.com/web/updates/2019/02/rendering-on-the-web" rel="noopener noreferrer"&gt;this article&lt;/a&gt; for more details).&lt;/p&gt;

&lt;p&gt;Bottom line: if your JavaScript is modifying your frontend you might have been looking at very &lt;strong&gt;skewed LCP numbers&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Give me data: what has changed?
&lt;/h3&gt;

&lt;p&gt;Since Chrome 88 has been out for a few weeks now, we actually have the &lt;strong&gt;data&lt;/strong&gt; to underpin our hypotheses. At Baqend, we are building &lt;a href="https://www.baqend.com/" rel="noopener noreferrer"&gt;Speed Kit&lt;/a&gt;, a SaaS plugin solution to speed up websites based on JavaScript and Service Workers. Our approach relies on measuring the achieved performance uplift through real-user monitoring and A/B testing. Therefore, we have lots of data, since Speed Kit comes with a performance monitoring tool that measures speed metrics for every page view and in particular captures the Core Web Vitals.&lt;/p&gt;

&lt;p&gt;Here are the changes we observed between** January 20 and February 4*&lt;em&gt;, when comparing Chrome browser with version &amp;lt;88 to the current version 88. The data set consists of **122 Million page views&lt;/em&gt;* from Chrome browsers across roughly 45 e-commerce customer websites. Around 70% of the traffic comes from Europe the rest is spread across all continents. Overall, 51.1% of traffic came from Chrome browsers with a version &amp;lt;88, 48.9% were coming from Chrome 88.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F4968%2F1%2ApPAtB800zSwXwUhpTREYlA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F4968%2F1%2ApPAtB800zSwXwUhpTREYlA.png" alt="Analysis of the LCP changes across 122 Million Page Views and different quantiles."&gt;&lt;/a&gt;&lt;em&gt;Analysis of the LCP changes across 122 Million Page Views and different quantiles.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;As expected, the impact varies heavily across customers — this seems logical since not all of them a modifying LCP-relevant elements with JavaScript. The following scatter plot show the impact across all analyzed customers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F3768%2F1%2A2pw66FwIefioOTGCUA3mPg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F3768%2F1%2A2pw66FwIefioOTGCUA3mPg.png" alt="Scatter plot of LCP change across customers."&gt;&lt;/a&gt;&lt;em&gt;Scatter plot of LCP change across customers.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Findings:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Across the median, 75th, 90th, and 95th percentile, the LCP has consistently become &lt;strong&gt;~20% faster&lt;/strong&gt; in Chrome 88.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;For the** 99th percentile** (so the slowest 1% of page views) the change is a whopping &lt;strong&gt;43.75%.&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Not all websites are alike, however, with very few exceptions the new LCP calculation has led to an &lt;strong&gt;improvement&lt;/strong&gt;. There seems to be *no *correlation between the traffic/size of the site and the LCP change.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Conclusions
&lt;/h3&gt;

&lt;p&gt;From this preliminary analysis, we expect drastic changes in the LCP. Whether this warrants to adapt the — already quite generous — threshold of up to 2.5 seconds considered as a “fast LCP” remains to be seen. For now, the good news is, that JavaScript-heavy sites need not longer fear a negative skew for the LCP. We will get back with an update once the CRUX data (updated once per month) allow a first confirmation of our findings in the “official” data sources.&lt;/p&gt;

</description>
      <category>webperf</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
