Optimize web performance for faster loading and better user experience. Use when asked to "speed up my site", "optimize performance", "reduce load time", "fix slow loading", "improve page speed", or "performance audit".
Optimize web performance for faster loading and better user experience. Use when asked to "speed up my site", "optimize performance", "reduce load time", "fix slow loading", "improve page speed", or "performance audit".
license
MIT
metadata
{"author":"web-quality-skills","version":"1.0"}
Performance optimization
Deep performance optimization based on Lighthouse performance audits. Focuses on loading speed, runtime efficiency, and resource optimization.
How it works
Identify performance bottlenecks in code and assets
Prioritize by impact on Core Web Vitals
Provide specific optimizations with code examples
Measure improvement with before/after metrics
Performance budget
Resource
Budget
Rationale
Total page weight
< 1.5 MB
3G loads in ~4s
JavaScript (compressed)
< 300 KB
Parsing + execution time
CSS (compressed)
< 100 KB
Render blocking
Images (above-fold)
< 500 KB
LCP impact
Fonts
< 100 KB
FOIT/FOUT prevention
Third-party
< 200 KB
Uncontrolled latency
Critical rendering path
Server response
TTFB < 800ms. Time to First Byte should be fast. Use CDN, caching, and efficient backends.
Enable compression. Gzip or Brotli for text assets. Brotli preferred (15-20% smaller).
HTTP/2 or HTTP/3. Multiplexing reduces connection overhead.
Edge caching. Cache HTML at CDN edge when possible.
<!-- Show static placeholder until interaction --><divclass="youtube-facade"data-video-id="abc123"onclick="loadYouTube(this)"><imgsrc="/thumbnails/abc123.jpg"alt="Video title"><buttonaria-label="Play video">▶</button></div>
Measurement
Key metrics
Metric
Target
Tool
LCP
< 2.5s
Lighthouse, CrUX
FCP
< 1.8s
Lighthouse
Speed Index
< 3.4s
Lighthouse
TBT
< 200ms
Lighthouse
TTI
< 3.8s
Lighthouse
Testing commands
# Lighthouse CLI
npx lighthouse https://example.com --output html --output-path report.html
# Web Vitals library
import {onLCP, onINP, onCLS} from 'web-vitals';
onLCP(console.log);
onINP(console.log);
onCLS(console.log);
References
For Core Web Vitals specific optimizations, see Core Web Vitals.