What we have learned building a transforming image proxy: formats, caching, and the arithmetic behind a page that loads quickly — and, now and then, what is new here.
A mobile app has no srcset and sends no browser Accept header by default. How to authenticate without putting an API key in the binary, snap device widths so you do not fragment the cache, pick AVIF or WebP, and ship layout changes through presets instead of an App Store review.
Changing image service is mostly a rename. Where the originals live decides the rest, and running both side by side turns a risky switch into a few checked templates and one DNS record.
next/image writes good markup and, by default, resizes on your own server. A custom loader keeps the first and moves the second — which widths Next asks for, and what to set so it asks for the right ones.
Credits are charged for inference, not for traffic, so a cut-out shown a million times is paid for once. The rates, a worked catalogue, and exactly when a rendition is charged again.
Stop other sites embedding your images on your bandwidth, turn away AI crawlers and scrapers, and keep search engines and link previews working — set once for the whole account.
Nearest, bilinear, bicubic, Lanczos: every classical upscaler is a weighted average, and an average cannot contain detail its inputs never had. What a learned model does instead — and why plausible is not the same as true.
A transforming proxy in front of an origin you already run. The problem it solves, why it takes that shape, and the teams it was built for.
Centre-cropping fails on rule-of-thirds composition, group shots and anything with copy space. What a saliency map actually predicts, why it needs a centre bias, and what to cache so it stays affordable.
srcset, sizes, and why a continuous range of widths is the wrong answer. How to pick a handful of sizes and stop shipping a 2000px hero to a phone.
Reserving the space costs nothing and is skipped constantly. Filling it is the second half — and the placeholder tiers differ by an order of magnitude in bytes for a difference few users can see.
Every parameter you allow in a URL is a dimension. Four of them turn one image into a few thousand renditions, and the arithmetic is worth doing before your origin bill does it for you.
A domain allow-list stops another site embedding your images. It does not stop anyone who has your key, because the header it trusts is written by the caller — and omitting it is easier than forging it.
Content negotiation done properly — what the Accept header actually tells you, why Vary matters more than the format you picked, and how to avoid serving AVIF to something that cannot read it.
Before fonts, before JavaScript, before anything clever: the pictures. Why image bytes dominate a page, and the three changes that move the number most.
Making a 300px thumbnail from a 24-megapixel photograph does not require decoding 24 megapixels. How JPEG's block structure lets you skip most of the work, and when it does not apply.
A photograph carries GPS coordinates, a camera serial number and a thumbnail that does not update when you crop. What to strip, and the two tags that break the picture if you strip them blindly.