Core Web Vitals: How to Measure and Improve Them?
Tags: corewebvitals, seo
Published: 2021-07-29 07:11:08

<!-- wp:heading -->
<h2>What are Web Vitals?</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Web Vitals are the new standard introduced by Google – a collection of metrics against which websites are now rated. This standard puts more emphasis on user experience and website performance. Web vitals is a much stricter rating system than the previous one.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>We can check the website rating on <a href="https://developers.google.com/speed/pagespeed/insights/" target="_blank" rel="noreferrer noopener nofollow">PageSpeed Insights</a>, and many people may think that the result we get is the actual result of the page speed. The reality is a bit different. The website doesn't have to be the fastest to have the best score. It must be fast and friendly enough so users can move around pleasantly and comfortably.</p>
<!-- /wp:paragraph -->

<!-- wp:image -->
<figure class="wp-block-image"><img src="https://lh3.googleusercontent.com/JgUFMxVOWC36fNrmjQBME4ctyEP6ENXp_EePScGRpoJJ1a34QX2m1YnGuDtwS5uaVI3PHsdHQw6A1E70KZAb8zapqeB5Vr6avQpQFafCTNAA5exfupOrXglq0tZwFvpEfNu-Dn5C" alt="Web Vitals: LCP, FID and CLS"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>For now, the Web Vitals metric focuses mainly on three aspects of user experience:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><li>Loading&nbsp;</li><li>Interactivity&nbsp;&nbsp;</li><li>Visual stability</li></ul>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p>Web Vitals Metrics:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><li>Largest Contentful Paint</li><li>First Input Delay</li><li>Cumulative Layout Shift</li></ul>
<!-- /wp:list -->

<!-- wp:heading -->
<h2><br><br>Largest Contentful Paint</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p><strong>Largest Contentful Paint (LCP)</strong> measures how long it takes to load the largest element visible on the page. The element can be, for example, text, image, video. The LCP is valid if it lasts less than 2.5s. If it lasts from 2.5s to 4s, it needs improvement. The result above 4s is a bad result which significantly lowers the page rating.</p>
<!-- /wp:paragraph -->

<!-- wp:image -->
<figure class="wp-block-image"><img src="https://lh3.googleusercontent.com/YU7z7O80jTE1OMnenUeNl4hvAqvVG_7XPwM4qJM2BCGirPryRrf8BPzGYPKJyXdH5EX456V6-CwS9DI9scK3s5ac6gX40xMptRs8tFPBqSy1JtkadCxqrUR0k5rgl3hZO32TWdPs" alt="Web Vitals: LCP (Largest Contentful Point)"/></figure>
<!-- /wp:image -->

<!-- wp:heading {"level":3} -->
<h3>How to improve the LCP score?</h3>
<!-- /wp:heading -->

<!-- wp:list -->
<ul><li>Server optimisation</li><li>Caching</li><li>Establish third-party connections early:<ul><li>third-party server requests can also negatively impact the LCP (mainly when they are needed to display critical content on the page). Using rel="preconnect" to tell the browser that the site will connect as soon as possible may help in this situation.</li></ul></li><li>CSS optimisation<ul><li>for example - try not to nest selectors<ul><li>.h1 {} is better than .container &gt; .h1 {}</li></ul></li></ul></li><li>Putting critical CSS code into HTML<ul><li>the critical CSS code is the code that is needed to display the first page view properly. It's best to add this code inline in the &lt;style&gt; tag and put it in &lt;head&gt;</li></ul></li><li>Remove unused CSS or use <a href="https://github.com/filamentgroup/loadCSS/blob/master/README.md" target="_blank" rel="noreferrer noopener nofollow">loadCSS</a> to load files asynchronously</li><li>JavaScript optimisation</li><li>Reduce JavaScript payloads with <a href="https://web.dev/reduce-javascript-payloads-with-code-splitting/" target="_blank" rel="noreferrer noopener nofollow">code splitting</a></li><li>Optimise and compress images<ul><li>lazy-loading</li><li>use pictures with alternative formats such as .webp</li><li>reduce the size of photos/images</li></ul></li><li>Optimise web fonts<ul><li>&nbsp;for example – use font-display: swap</li></ul></li></ul>
<!-- /wp:list -->

<!-- wp:heading -->
<h2><br><br>First Input Delay</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p><strong>FID </strong>measures the time browser needs to react to the first interaction on the user’s part (handling events, e.g. clicking a button). A good time is under 100ms. The result above 300ms is very weak and requires improvement. In <strong>PageSpeed Insights</strong>, Time to Interactive is sort of FID.</p>
<!-- /wp:paragraph -->

<!-- wp:image -->
<figure class="wp-block-image"><img src="https://lh3.googleusercontent.com/P-G96Q1xGH317FwHxNuV4iYMS9lqrpy1VMedhyzgBznwx8ls4Ia6GjnDMpfmQKhnBkm2SHVh96m5xtOL5UFF5K79NLnkg5riwObvAxmQRiNaJ7zgJvXFtGpjFBRPgy_Y7Dw-6lyE" alt="Web Vitals: FID (First Input Delay)"/></figure>
<!-- /wp:image -->

<!-- wp:heading {"level":3} -->
<h3>How to improve the FID score?</h3>
<!-- /wp:heading -->

<!-- wp:list -->
<ul><li>Remove unused JS</li><li>Delay for third party scripts load</li><li>JavaScript optimisation</li><li>Delay loading scripts that are not required for the correct display of the website</li></ul>
<!-- /wp:list -->

<!-- wp:heading -->
<h2><br><br>Cumulative Layout Shift</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p><strong>CLS</strong> is an indicator of visual stability, which measures the sum of the shifts of all layout elements not related to the user's interaction. Shift happens when the browser suddenly reads page elements that move another element. And such shifts are often more annoying than slow page loading.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>An example of this is a pop-up advertisement that moves a button that we wanted to click on the page, but unfortunately, we clicked an ad. Google rightly believes that these are malicious solutions that lead to clicks on unwanted links. A good result is below 0.1. If the result is over 0.25, it needs improvement.</p>
<!-- /wp:paragraph -->

<!-- wp:image -->
<figure class="wp-block-image"><img src="https://lh3.googleusercontent.com/YB2827iCaFLLto50RZ_gPjiVArSW3FEUKcI3cEWgQ5RwBAUBg2GZPP11nZBD0RS4dKxk1qmkeXKsXIDszHXSXd6ow1n-pMVXrRoDEFKdTWFEaG1De7joBqDBvVybGzBpWrt7WR-C" alt=""/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Example</p>
<!-- /wp:paragraph -->

<!-- wp:image -->
<figure class="wp-block-image"><img src="https://lh5.googleusercontent.com/9GfnVXRnZXctyBC7ounsJ-d-YS6-QUoedTLs_xgZQ8o3aqvr8TtLUOyMZ1u2qivggaPMt8Dn60yRPZlVUEHBuMwq72UjsauPTV-XCSy_tmLWOwE1MjpBHXYcBsGpSqYsdWrwRTrE" alt="Web Vitals: CLS (Cumulative Layout Shift)"/></figure>
<!-- /wp:image -->

<!-- wp:heading {"level":3} -->
<h3>How to improve the CLS score?</h3>
<!-- /wp:heading -->

<!-- wp:list -->
<ul><li>Elements visible in the page loading area should have a <strong>declared height and width</strong>, so they don’t change their size when content loads.</li><li>Use font-display: swap for the text visibility in the loading area.</li><li>Avoid adding ads or add them in a fixed-size container.</li></ul>
<!-- /wp:list -->

<!-- wp:heading -->
<h2><br><br>How to measure Web Vitals?</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>To check whether our website meets Web Vitals’ requirements, we can use <strong>Google PageSpeed Insights</strong> and <strong>Google Search Console</strong>. There is one more way – a Google Chrome plugin for measuring Web Vitals, but the results are often deceptive, so I don’t recommend using it.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3><br>Google PageSpeed Insights</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Checks a single page, shows results of the analysis and offers suggestions for improving Web Vitals.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Additionally, the report in <a href="https://developers.google.com/speed/pagespeed/insights/" target="_blank" rel="noreferrer noopener nofollow">PageSpeed ​​Insights</a> visualises the indicators’ values taking into account the number of users in the bar chart.</p>
<!-- /wp:paragraph -->

<!-- wp:image -->
<figure class="wp-block-image"><img src="https://lh4.googleusercontent.com/yXgxPgGDQt3-xQFzD5c36nF29c5wUGgciiApinus8yUPVcZMqDr4mWtErrWnC4Fh4BWdK6si4TbWmkiGFp2jpmHy1OXpCR4hHX-3v0EOLLVVfsis-qgApld_ot1ib0ADz_Ll9dmy" alt="Google PageSpeed Insights score"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>In the example above, we can see that the FCP and CLS require improvement.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>FCP</strong> – 31% of the time this page loads, the First Contentful Paint (FCP) indicator is bad (&gt; 3 seconds).</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>CLS</strong> – 29% of the time this page loads, the Cumulative Layout Shift (CLS) is terrible (&gt; 0.25).</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3><br>Google Search Console</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p><a href="https://search.google.com/search-console/welcome" target="_blank" rel="noreferrer noopener nofollow">Google Search Console</a> is one of the best tools for website owners, where they can check the most critical information about the condition of their website in the eyes of Google.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>In GSC, the chart is generated for the entire website, and you can see on which subpages there are errors and what are the remedial actions.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Thanks to this tool, we can obtain information about pages that require improvement.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2><br><br>Summary</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Without a doubt, Web Vitals is a good standard. As a result, creators who want to get a good result will adapt websites to create a better user experience. Although Google tells developers how to deal with problems and increase results, we know that it can be different in practice, and the new standard will bring many issues to developers.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Google also points out that <strong>Web Vitals</strong> will be developed continuously, so these three indicators are probably just the beginning of the changes.</p>
<!-- /wp:paragraph -->