Netlify Image CDN
Transform images by requesting /.netlify/images with query parameters. No function or file authoring required — it's a built-in edge endpoint.
There is no legacy/deprecated form — the endpoint above is the only programmatic surface. Use framework image components where available (below) rather than hand-building URLs.
Endpoint & query parameters
GET /.netlify/images?url=<source>&...
fit behavior
fit=coverrequires BOTHwandh. Supplying only one silently misbehaves.containwith one dimension calculates the other to preserve aspect ratio.
Format & content negotiation
- Source-only request (just
url, no size/format): image is unchanged in size/shape but still reformatted toavif/webpbased on the browser'sAcceptheader. - No
fmspecified →webpif accepted, elseavifif accepted, else original. fm=blurhashreturns a BlurHash text string, not image bytes. Pointing<img src>or a CSS background at it renders nothing. Fetch the string server-side/ahead of time, decode it client-side with a BlurHash library (https://blurha.sh), then load the real image as a separate request withoutfm=blurhash.
Response codes
- Invalid transformation param values →
404. - Valid, new transformation →
200with content +content-type. - Previously transformed →
304.
Remote source images
Remote url values require allowlisting the domain in netlify.toml:
Then percent-encode the remote URL and request it:
- Always
encodeURIComponentthe remote URL before placing it inurl— URLs containing?or&break otherwise. - In
remote_imagespatterns, escape only the dot:'https://example\.com/.*'. Forward slashes are NOT regex metacharacters — do not writehttps:\/\/. - Remote sources must be publicly accessible. Netlify does NOT forward
AuthorizationorCookieheaders to remote sources. For auth-required images use self-authorizing URLs (e.g. S3 presigned URLs) and make sure yourremote_imagespattern matches them.
Reusable transformations (redirects)
Reuse the same params across many images via a redirect:
_redirects:
netlify.toml:
Then GET /transform-small/owl.jpeg yields a 50×50 transform. Avoid cross-site redirects for transformations — they hurt performance.
Custom headers (caching)
_headers:
- Headers set on a source image are applied to the transformed asset served by Image CDN.
- Custom headers cannot be applied to remote (other-domain) source images; Netlify respects whatever cache headers the external domain sends.
Cache-Controlon source images applies only to browsers/CDNs in front of Netlify, not the Netlify Cache itself.
Framework integrations
Use the framework's native image component/handling; it wires to Image CDN automatically. Configure the remote allowlist per framework:
Local development
Run netlify dev (Netlify CLI) to test transformations locally — it mimics production including Image CDN.
- A local
404on/.netlify/imagesalmost always means a framework dev server (vite,next dev,astro dev) is running instead ofnetlify dev. The endpoint,[images]allowlisting, and image redirects only exist undernetlify dev. The URL itself is usually fine.
Caching & deploys
Transformed results are uniquely cached on Netlify's edge. Atomic deploys are respected: changing a source image in a new deploy re-runs transformations on new requests so stale assets aren't served.
User-uploaded image pipelines
For user-uploaded image pipelines (Functions + Blobs + Image CDN composed), see references/user-uploads.md in this skill.
Limitations
- Split Testing is not supported — you may get inconsistent image results between split test branches.
- Not currently supported in Netlify's HIPAA-compliant hosting offering. See the Trust Center for the HIPAA-compliant reference architecture.
Netlify house rules (image-cdn)
These are org conventions, not docs facts — merged into the rendered skill by ctx-gen and never generated. Owned by the skills maintainer.
- For user-uploaded image pipelines (Functions + Blobs + Image CDN
composed), see
references/user-uploads.mdin this skill — an authored guide with no single docs source. - Percent-encode remote source URLs before placing them in the
urlparameter (encodeURIComponent) — URLs containing?or&break otherwise. fm=blurhashreturns a BlurHash TEXT string, not image bytes. Pointing an<img src>(or CSS background) at it renders nothing — fetch the string ahead of time, decode it client-side with a BlurHash library, and load the real image as a separate request withoutfm=blurhash.- A local 404 on
/.netlify/imagesalmost always means a framework dev server (vite,next dev,astro dev) is running instead ofnetlify dev— the endpoint,[images]allowlisting, and image redirects only exist undernetlify dev. The URL itself is usually fine. - In
remote_imagespatterns, the meaningful regex escape is the dot; forward slashes are not metacharacters — do not writehttps:\/\/. Innetlify.toml, use a single-quoted literal string ('https://example\.com/.*') or double the backslash in a double-quoted string ("https://example\\.com/.*") — a bare\.inside double quotes is invalid TOML.


