Pinterest > Pinterest reduced perceived wait times by 40% and this increased search engine traffic and sign-ups by 15%. Performance is about improving conversions Performance is about user experience Performance is about people
from when the page starts loading to when any part of the page's content is rendered on the screen. https://web.dev/i18n/en/fcp/ SI Speed Index (SI) is a page load performance metric that shows you how quickly the contents of a page are visibly populated. https://developer.mozilla.org/en-US/docs/Glossary/Speed_index https://developer.chrome.com/docs/lighthouse/performance/speed-index/ LCP 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.
the page starts loading to when its main sub-resources have loaded and it is capable of reliably responding to user input quickly. https://web.dev/i18n/en/tti/ TBT Total Blocking Time (TBT) metric measures the total amount of time between First Contentful Paint (FCP) and Time to Interactive (TTI) where the main thread was blocked for long enough to prevent input responsiveness. https://web.dev/i18n/en/tbt/ 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.
transfer data as few times as possible ③ To keep the data transfer distance as short as possible Principles of optimisation of network part ① request ② request ③ data data far close
big packages eg.) Lodash → Rewriting to Vanilla JavaScript icons package → Rewriting to SVG (Import only you need) css-ui package → Rewriting to Pure CSS eg.) moment.js → change to other package (day.js, date-fns) react-router → wouter
etc… Converting font to WOFF2 Assets Optimization https://github.com/GoogleChromeLabs/squoosh 🖼 Images ✏ Fonts https://github.com/papandreou/subset-font ※Some browsers are still not supported. Our clients may be using even older browsers 😩 https://github.com/imagemin/imagemin-cli
Request (resouces and data) Data payload Initial request <html /> SPA SSR SSR is shorter TTI (Time to Interactive) 🚀 Interactive Interactive Server-Side Rendering might be overkill for our service…