page-speed-basics/SKILL.md
Facts to use
- Core Web Vitals and the "good" thresholds, measured at the 75th percentile of real page loads:
- Largest Contentful Paint (LCP): 2.5 seconds or less.
- Interaction to Next Paint (INP): 200 milliseconds or less.
- Cumulative Layout Shift (CLS): 0.1 or less.
- Field data (real users, from the Chrome UX Report) is what Search Console shows. Lab data (Lighthouse) helps find causes.
Workflow
- Read the Core Web Vitals report in Search Console and run PageSpeed Insights on the main templates.
- For poor LCP, check in this order: slow server response, a large hero image, render-blocking CSS or JavaScript, the LCP element loaded late by JavaScript, lazy loading on the LCP image.
- For poor INP: long JavaScript tasks, large bundles, heavy third-party scripts, expensive work in event handlers.
- For poor CLS: images and embeds without width and height, ads or banners that push content, web fonts that swap late.
- Fix the top cause per template first. Re-test after each change.
Common fixes
- Serve images in modern formats at the displayed size. Set
widthandheight. - Do not lazy-load the LCP image. Consider
fetchpriority="high"on it. - Split JavaScript by route. Defer scripts that the first view does not need.
- Reserve space for banners and embeds.
Output
A table per template: metric, field value, cause found, fix, expected effect.
Sources
- web.dev: How the Core Web Vitals metrics thresholds were defined. https://web.dev/articles/defining-core-web-vitals-thresholds