Web Performance Optimization
Systematic approach: Measure → Identify → Prioritize → Implement → Verify.
Target Metrics
Quick Wins
1. Images (usually biggest impact on LCP)
Always set width and height to prevent CLS.
2. Fonts (common LCP/CLS culprit)
3. Third-party Scripts (common INP killer)
4. Critical CSS
Inline critical CSS in <head>, defer the rest:
Bundle Analysis
Common heavy packages to replace:
moment(67KB) →date-fns(12KB) ordayjs(2KB)lodash(72KB) → cherry-pick imports or native methods
Code Splitting Patterns
Caching Headers
Measurement
For running audits, reading reports, and setting budgets, use the perf-lighthouse skill.
Checklist
Images
- Modern formats (WebP/AVIF)
- Responsive
srcset -
width/heightattributes -
loading="lazy"below fold -
fetchpriority="high"on LCP image
JavaScript
- Bundle < 200KB gzipped
- Code splitting by route
- Third-party scripts deferred
- No unused dependencies
CSS
- Critical CSS inlined
- Non-critical CSS deferred
- No unused CSS
Fonts
-
font-display: swap - Preconnect to font origin
- Subset if possible
Detailed Examples
For in-depth optimization patterns, see:
- references/core-web-vitals.md [blocked] - Fixing LCP, CLS, INP issues
- references/bundle-optimization.md [blocked] - Reducing JS bundle size
- references/image-optimization.md [blocked] - Image formats, responsive images, sharp scripts

