Home >Technology peripherals >It Industry >Core Web Vitals: A Guide to Google's Web Performance Metrics
Understanding Google's Core Web Vitals and its promotion methods
Core points:
Google wants users to have a good web experience, so websites that rank higher in search results also load faster. Of course, this is a big simplification, but assuming you are comparing two sites with similar content and audiences, the faster loading websites should rank higher in the results. However, Google’s method of measuring this metric has always been somewhat elusive, so it introduces core web metrics to provide website owners and developers with some much-needed clarity. Unfortunately, "performance" is a general term covering dozens of metrics...
First byte time, start rendering, CPU usage, JavaScript heap size, first content drawing, first meaningful drawing, first time CPU idle, DOM loading, page full loading, interaction time, style recalculating per second, and so on. Different tools return different result sets, and it is difficult to know where to start.
Google's web metrics program is designed to simplify performance evaluation and help you focus on the most important improvements. Core web metrics are key performance metrics that reflect real-world user experience. Some metrics are reported by the Lighthouse panel, PageSpeed Insights, and Google Search Console in Chrome DevTools.
web-vitals JavaScript library can help measure more realistic metrics from real users visiting your website. Results can be published to Google Analytics or other endpoints for further analysis.
Google recommends using the 75th percentile, which is to record multiple results for the same metric, sort in order from best to worst, and then analyze the values of three quarters. Therefore, three-quarters of website visitors will experience this level of performance.
The current core web metrics are maximum content drawing, first input delay, and cumulative layout offset, which evaluate loading, interactivity, and visual stability, respectively.
Maximum Content Drawing (LCP)
LCP measures loading performance—Speed speed of content display.
Historical metrics such as page loading and DOMContentLoaded have always been problematic in this regard, because they do not always reflect the user experience. For example, the spoiler can appear almost immediately, but it may take longer to appear that it is loaded with a further Ajax request.
Maximum Content Drawing (LCP) Reports the rendering time of the largest image or text block visible in the viewport. Times less than 2.5 seconds are considered good, while times more than 4.0 seconds are considered bad.
The types of elements considered in LCP include:
<img src="/static/imghwm/default1.png" data-src="https://img.php.cn/upload/article/000/000/000/173949835734928.jpg" class="lazy" alt="Core Web Vitals: A Guide to Google's Web Performance Metrics">
<p>Logos and menus do not move – they are stable elements. The ad is added to the DOM and its starting position does not change, so it is also stable. However, the hero image will move: </p>
<ol>
<li>Hero image is 360 x 510 pixels in the 360 x 720 pixel viewport. Therefore, its impact score is (360 x 510) / (360 x 720) = 0.71</li>
<li>It moves vertically by 90 pixels in the viewport height of 720 pixels, so its distance fraction is 90 / 720 = 0.125</li>
</ol>
<p> Therefore, the CLS is 0.71 x 0.125 = 0.089</p>
<p> CLS scores below 0.1 are considered good, while those above 0.25 are considered bad. In this case, the CLS is within an acceptable range because although the affected area is large, the distance to move is relatively small. However, bigger advertising needs further attention. </p>
<p> The CLS algorithm does not record any layout offsets within 500 milliseconds of user interaction, which may trigger UI changes or viewport resize. Therefore, your page will not be penalized for interface updates, transitions, and animations that are necessary for operations, such as opening a full-screen menu from the hamburger icon. </p>
<p>The Rendering panel (menu > More Tools > Rendering) in Chrome DevTools provides the Layout Offset Area option. Select the box and refresh the page – the layout offset is highlighted in blue. You can also modify the network speed in the Network panel to slow down loading. </p>
<p>FID/TBT can be improved by: </p>
<ol>
<li>Reserve space for image, video and iframe elements by using <code>width
and height
properties, CSS aspect-ratio
properties, or old fill tips (as the case may be) transform
and opacity
for less costly animations. Performance priority
Core web metrics will develop over time, but evaluating LCP, FID, and CLS metrics can help identify the most critical issues. Solve quick and simple puzzles first – they usually have the greatest ROI:
Core Web Metrics FAQ
The above is the detailed content of Core Web Vitals: A Guide to Google's Web Performance Metrics. For more information, please follow other related articles on the PHP Chinese website!