Front-End and Edge Performance Optimization
Where the wins are
Front-end performance is dominated by critical rendering path work: HTML parsing, CSS blocking render, and synchronous JavaScript blocking the parser. Techniques: defer/non-blocking scripts, inlining critical CSS, preloading key resources (preload, preconnect, dns-prefetch), and lazy-loading below-the-fold images. Compression matters - Brotli typically beats gzip for text - and modern image formats (WebP/AVIF) plus correct dimensions reduce bytes and layout shift. HTTP/2 and HTTP/3 change bundling economics: multiplexing reduces the need for aggressive concatenation, and HTTP/3/QUIC avoids TCP head-of-line blocking on lossy networks.
Edge-side optimization
Edge compute can rewrite HTML, inject headers, resize images, and personalize responses close to users. Edge image optimization and automatic minification remove work from the client. Understand that edge logic adds a small processing cost but saves round trips to origin.
Traps
- Assuming more concatenation is always better - it can hurt caching granularity under HTTP/2+.
preconnectwarms connections but does not fetch the resource;preloadfetches but must match the real request or it is wasted.- Compression should not be applied to already-compressed binaries (images, video).
- Lazy-loading the hero/LCP image harms Largest Contentful Paint.
Rule of thumb
Optimize for the metric you are judged on: for LCP, prioritize the hero resource (preload, no lazy-load, fast TTFB); for CLS, set explicit dimensions; for INP, reduce main-thread JavaScript.