Cutting a content site's image payload by 70%: browser-side compression wins
Browser-side compression eliminates the server resource cost and upload latency that server-side or CDN processing imposes, and it keeps sensitive images off third-party servers. For any site with high upload volume or privacy concerns, this pattern is a concrete way to reclaim double-digit Lighthouse points without extra infrastructure.
A content site was failing Lighthouse with a Performance score of 38, a 2.4MB banner image, and 6-second first-screen loads. The root cause was uncompressed photos and screenshots hitting the CDN directly; hundreds of articles made server-side or CDN-side recompression impractical.
The fix combined two browser-side approaches. For editor uploads, `browser-image-compression` runs Canvas-based compression client-side before the file goes to the server, cutting a typical 3MB phone JPEG to 300-500KB. For existing images and sensitive screenshots, the engineer used Glazlo, a purely browser-based tool that never uploads files to a server, and supports targeting a specific output size.
Results: Performance went from 38 to 72, LCP from 6.2s to 2.1s, and homepage image payload from 4.8MB to 1.4MB. The article also documents four pitfalls: Canvas JPEG conversion drops PNG transparency, WebP falls back poorly on old Safari, low JPEG quality banding on text-heavy images, and missed compression of responsive image variants.
The biggest win came from phone JPEGs, not engineered assets, which means many sites still have huge untapped savings in user-generated content.
Browser-side compression solves both server load and upload time in one move, making it a better fit for small infrastructure than CDN processing or server-side Sharp.
The transparency pitfall with Canvas toBlob is a reminder that client-side image pipelines need format-aware handling, not just quality tuning.
Glazlo's browser-only processing is notable for privacy-sensitive screenshots, a concern that often gets ignored in favor of convenience.
The 200KB target for WeChat covers shows that matching platform limits isn't the same as optimizing for real loading performance.