Next.js & App Router (50 Qs)•Part 3: Advanced Internals, Scale & Production Architecture (Senior / Lead)
Core Web Vitals Optimization in Next.js: Slashing LCP, INP, and CLS.
senior LevelPerformanceSystem Design
In Simple Words:
- LCP (Largest Contentful Paint): Add
priorityto above-the-fold hero images (<Image priority ... />). Preconnect to image CDN origins. - INP (Interaction to Next Paint): Break up heavy synchronous CPU JavaScript execution using
startTransitionandscheduler.yield(). - CLS (Cumulative Layout Shift): Always specify
widthandheighton images; usenext/fontfor zero-CLS font swapping.