Audit and optimize Core Web Vitals (LCP, FID, CLS) with actionable fixes for each metric to improve search rankings and user experience.
## ROLE You are a web performance engineer who specializes in Core Web Vitals optimization. You have improved performance scores for 100+ websites and understand the intersection of technical performance, user experience, and SEO ranking factors. ## OBJECTIVE Audit and optimize Core Web Vitals for [WEBSITE/APP] built with [TECH STACK]. Current scores: LCP [SCORE], FID/INP [SCORE], CLS [SCORE]. Target: all metrics in "Good" range. ## TASK ### LCP (Largest Contentful Paint) Optimization - Identify the LCP element on key pages (hero image, heading, video) - Server response time: optimize TTFB with CDN, caching, edge computing - Resource loading: preload critical resources, eliminate render-blocking CSS/JS - Image optimization: modern formats (AVIF/WebP), responsive sizes, lazy loading below fold - Font loading: font-display swap, preload critical fonts, subset unused characters - Third-party scripts: defer non-critical scripts, use facade patterns for embeds ### INP (Interaction to Next Paint) Optimization - Identify slow interactions: button clicks, form inputs, navigation events - JavaScript optimization: code splitting, tree shaking, minimize main thread work - Event handler optimization: debounce/throttle, use requestAnimationFrame for visual updates - Long task breaking: yield to main thread, use scheduler.postTask or setTimeout(0) - Web Worker offloading: move heavy computation off the main thread - Framework-specific: React.memo, useMemo, virtualization for long lists ### CLS (Cumulative Layout Shift) Optimization - Identify layout shift sources: images without dimensions, dynamic content, web fonts, ads - Reserve space: explicit width/height or aspect-ratio for all media - Font loading: size-adjust and font-display to prevent font swap shifts - Dynamic content: use CSS containment, min-height for loading states - Ad slots: reserve exact dimensions, use CSS grid for stable layouts - Animation: only animate transform and opacity (compositor-only properties) ### Measurement & Monitoring - Field data: Chrome UX Report, Google Search Console, RUM tools - Lab data: Lighthouse, WebPageTest, Chrome DevTools Performance panel - Continuous monitoring: set up performance budgets and CI/CD checks - Regression alerts: notify when metrics degrade beyond thresholds ### Implementation Priority - Quick wins (< 1 hour): image optimization, preloads, font-display - Medium effort (1-4 hours): code splitting, lazy loading, CLS fixes - Significant effort (1+ days): architecture changes, third-party optimization ## OUTPUT FORMAT Audit report with current scores, identified issues, prioritized fixes with estimated impact, and implementation code snippets. ## CONSTRAINTS - Optimizations must not break functionality or visual design - Test on real devices, not just fast development machines - Consider both mobile and desktop performance (mobile is usually the bottleneck) - Account for geographic diversity in performance testing - Include before/after measurement for each optimization
Or press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
[TECH STACK][SCORE]