It's not "400 images", it's every image × width × format combination that gets generated. With fill and no sizes, the browser can ask for many widths, and each is a separate transformation.
What I'd do:
- Add a real
sizesprop to every gallery image (e.g.sizes="(max-width: 768px) 100vw, 33vw"), so fewer widths are requested. - Trim
images.deviceSizes/imageSizesin next.config to the 3-4 widths your layout actually uses. - Raise
images.minimumCacheTTL(photos never change), so cached results are reused instead of regenerated. - For the originals: export them as WebP at 2 sizes yourself and use
unoptimizedon those. Photographers care about quality anyway, you control the compression.
The Reddit spike will pass, but #1 and #3 alone usually cut this a lot.
sizeson the Image tags? sarah_k_dev · edited