Frontend Engineering

Web Performance Optimization Checklist: Achieve a 100/100 Lighthouse Score

A practical engineering guide to optimizing Core Web Vitals, LCP, INP, CLS, image assets, and JavaScript bundle sizes.

By Careers.codes Editorial Team | 12 min read

Summary: Master web performance engineering. Learn how to optimize Core Web Vitals (LCP, INP, CLS), compress images with WebP/AVIF, implement route code-splitting, reduce JS bundle sizes, and configure CDN caching.

1. Why Web Performance Drives Traffic & SEO

Page load speed is a direct ranking factor in Google's search algorithm. Fast websites retain users, lower bounce rates, and achieve higher conversion rates. A 1-second delay in page load time can reduce conversions by up to 20%.

2. Demystifying Core Web Vitals (LCP, INP, CLS)

Google measures real-world user experience using three core performance metrics: * **Largest Contentful Paint (LCP < 2.5 seconds):** Measures how long it takes for the largest visual element (hero image or main heading) to render. * **Interaction to Next Paint (INP < 200 milliseconds):** Measures UI responsiveness when users click buttons, open dropdowns, or type in inputs. * **Cumulative Layout Shift (CLS < 0.1):** Measures visual stability to ensure elements do not shift unexpectedly during load.

3. Image & Media Asset Optimization Pipeline

Images account for over 60% of average page weight. Follow these image optimization rules: * **Convert Images to Modern Formats:** Convert legacy PNG/JPG images to WebP or AVIF format to reduce file sizes by 70%. * **Set Explicit Dimensions:** Always specify width and height attributes on tags to reserve layout space and eliminate CLS shifts. * **Implement Lazy Loading:** Use loading="lazy" for images located below the initial viewport fold. * **Preload Hero Images:** Use for critical LCP hero images.

4. JavaScript Bundle Reduction & Code Splitting

Heavy JavaScript bundles block the browser main thread, harming INP responsiveness. * **Route Code-Splitting:** Use React.lazy() or Next.js dynamic routing to load page JS bundles on-demand. * **Audit Dependency Sizes:** Use bundle-analyzer tools to identify heavy npm packages and replace them with lighter alternatives (e.g. replace moment.js with date-fns or native Intl). * **Tree Shaking:** Ensure modern ES module syntax (import/export) so bundlers can strip out dead code paths.

5. Server-Side Caching & CDN Edge Header Strategies

Configure HTTP caching headers on static assets to enable instant repeat page visits: `Cache-Control: public, max-age=31536000, immutable`