美文网首页
Web Performance

Web Performance

作者: 张Piers | 来源:发表于2022-11-19 22:12 被阅读0次

    What is web performance?

    Web performance is the objective measurement and perceived user experience of a website or application.

    核心 Web 指标和阈值

    1. image
      what is LCP: Largest Contentful Paint 最大内容绘制 (LCP),The Largest Contentful Paint (LCP) metric reports the render time of the largest image or text block visible within the viewport, relative to when the page first started loading.

      what is good LCP score: To provide a good user experience, sites should strive to have Largest Contentful Paint of 2.5 seconds or less. To ensure you're hitting this target for most of your users, a good threshold to measure is the 75th percentile of page loads, segmented across mobile and desktop devices.

      how to improve LCP: https://web.dev/optimize-lcp/#slow-servers

    1. image
      what is FID: First Input Delay 首次输入延迟,FID measures the time from when a user first interacts with a page (i.e. when they click a link, tap on a button, or use a custom, JavaScript-powered control) to the time when the browser is actually able to begin processing event handlers in response to that interaction.

      what is good FID score: sites should strive to have a First Input Delay of 100 milliseconds or less. To ensure you're hitting this target for most of your users, a good threshold to measure is the 75th percentile of page loads, segmented across mobile and desktop devices.

      how to improve FID: https://web.dev/fid/#how-to-improve-fid

    1. image.png

      what is CLS: CLS is a measure of the largest burst of layout shift scores for every unexpected layout shift that occurs during the entire lifespan of a page.

      what is goog CLS score: sites should strive to have a CLS score of 0.1 or less. To ensure you're hitting this target for most of your users, a good threshold to measure is the 75th percentile of page loads, segmented across mobile and desktop devices.

      how to improve CLS: https://web.dev/cls/#how-to-improve-cls

      • Always include size attributes on your images and video elements, or otherwise reserve the required space with something like CSS aspect ratio boxes. This approach ensures that the browser can allocate the correct amount of space in the document while the image is loading. Note that you can also use the unsized-media feature policy to force this behavior in browsers that support feature policies.
      • Never insert content above existing content, except in response to a user interaction. This ensures any layout shifts that occur are expected.
      • Prefer transform animations to animations of properties that trigger layout changes. Animate transitions in a way that provides context and continuity from state to state.
    1. image.png

      what is FCP: The First Contentful Paint (FCP) metric measures the time from when the page starts loading to when any part of the page's content is rendered on the screen.

      what is good FCP score: sites should strive to have a First Contentful Paint of 1.8 seconds or less. To ensure you're hitting this target for most of your users, a good threshold to measure is the 75th percentile of page loads, segmented across mobile and desktop devices.

      how to improve FCP: https://web.dev/fcp/#how-to-improve-fcp

    2. how to measure LCP FID CLS(tools): PageSpeed Insights, chrome devtool>lighthouse

    CRP

    image.png

    Refer To

    https://web.dev/i18n/zh/defining-core-web-vitals-thresholds/

    https://web.dev/optimize-lcp/#slow-servers

    https://web.dev/fast/

    https://github.com/w-l-l/BrowserPrinciple

    相关文章

      网友评论

          本文标题:Web Performance

          本文链接:https://www.haomeiwen.com/subject/nrubtdtx.html