Answer
Network / loading:
- Code splitting & lazy loading (
import(), route-based chunks). - Minify, compress (gzip/brotli), tree-shake; reduce bundle size.
- HTTP caching (
Cache-Control, ETags), CDN, HTTP/2-3. - Preload/prefetch critical assets;
defer/asyncscripts. - Image optimization: modern formats (WebP/AVIF), responsive
srcset, lazyloading="lazy".
Rendering:
- Minimize critical render path; inline critical CSS.
- Avoid layout thrashing (batch DOM reads/writes).
- Virtualize long lists (windowing).
- Debounce/throttle expensive handlers.
React/runtime:
React.memo,useMemo,useCallback, stable keys.- Avoid unnecessary re-renders and large context updates.
Measure first: use Lighthouse, Web Vitals (LCP, CLS, INP) to find the real bottleneck before optimizing.