DEV Community

Dev Cookies
Dev Cookies

Posted on

πŸš€ Frontend Performance Optimization Checklist: A one-stop solution to master Core Web Vitals

βœ… 1. First Contentful Paint (FCP)

Target: < 1.8s

πŸ“Œ First visual feedback to the user

βœ… Best Practices:

  • ⏩ Use CDN for static assets
  • 🎯 Inline critical CSS
  • 🧼 Minify & defer non-critical CSS/JS
  • πŸ–ΌοΈ Optimize above-the-fold images
  • πŸ” Preload key resources (<link rel="preload">)
  • 🌐 Reduce server response time (use cache, edge computing)

βœ… 2. Largest Contentful Paint (LCP)

Target: < 2.5s

πŸ“Œ Render the largest visible content quickly

βœ… Best Practices:

  • πŸ–ΌοΈ Use next-gen image formats: WebP, AVIF
  • 🧊 Compress & resize hero images
  • πŸ“₯ Preload the LCP image/font/asset
  • 🚫 Avoid lazy-loading above-the-fold content
  • πŸ’‘ Serve HTML quickly (SSR or static HTML for first load)

βœ… 3. Total Blocking Time (TBT)

Target: < 200ms

πŸ“Œ Main thread responsiveness during load

βœ… Best Practices:

  • 🧠 Break large JavaScript tasks into chunks
  • 🧡 Offload heavy computation to Web Workers
  • βœ‚οΈ Reduce third-party scripts and tracking pixels
  • πŸ“¦ Use code-splitting to reduce bundle size
  • πŸ’€ Lazy-load non-critical JS modules

βœ… 4. Cumulative Layout Shift (CLS)

Target: < 0.1

πŸ“Œ Avoid unexpected visual shifts

βœ… Best Practices:

  • πŸ”² Always define width and height for images/videos
  • πŸ“ Reserve space for dynamic content (ads, iframes)
  • πŸ”  Use font-display: swap to avoid FOIT (Flash of Invisible Text)
  • 🚫 Don’t insert DOM elements above existing content after page load
  • 🎞️ Use transform, not top/left, for animations

βœ… 5. Speed Index

Target: < 3.4s

πŸ“Œ How fast your page visually completes

βœ… Best Practices:

  • ⚑ Prioritize visible content first
  • πŸ”ƒ Defer offscreen and background content
  • 🧩 Preload critical resources (fonts, hero images)
  • 🌍 Minimize redirects & DNS lookups
  • πŸ› οΈ Reduce dependency size (lodash, moment.js, etc.)

πŸ› οΈ Tools You Can Use:

Tool Use Case
πŸ’‘ PageSpeed Insights Google's official performance audit
πŸ” Lighthouse (Chrome DevTools) Local performance & SEO audit
⚑ WebPageTest Visual load progress and request waterfall
πŸ§ͺ GTmetrix Page load speed and suggestions
πŸ“¦ Bundlephobia Check size of npm packages

Top comments (0)