SYSTEM Cited by 1 source
Cloudflare Images¶
Cloudflare Images is an image optimization and transformation service built in Rust on Workers, running on every machine in Cloudflare's edge network. It provides transformation (resize, rotate, transcode, composite) and delivery optimization for images.
Architecture¶
The Images service uses systems/hyper to manage HTTP connections. The service:
- Reads input image data from the socket.
- Performs requested optimization operations (transcode, composite, resize).
- Encodes the result in-memory.
- Hands the full encoded response to hyper as a single block for transmission.
Images Binding¶
The Images binding provides a programmatic API for Workers to invoke image operations without returning the result as an HTTP response. It decouples image optimization from delivery, supports arbitrary operation ordering, and enables chaining:
const result = await env.IMAGES
.input(image)
.transform({ width: 800, rotate: 90 })
.output({ format: "image/avif" });
Architecture Evolution (Dec 2025)¶
Originally, the binding communicated through FL (Cloudflare's internal intermediary for security/performance features) over network sockets. In December 2025, this was replaced with a local Unix socket connection directly between the Workers runtime and the Images service on the same machine. This:
- Eliminated FL's full processing pipeline overhead (DNS lookups, routing).
- Gave the Images team independent release control.
- Inadvertently surfaced a latent race condition in hyper due to slightly different socket read pacing (Source: sources/2026-06-22-cloudflare-how-we-found-a-bug-in-the-hyper-http-library).
Seen In¶
- sources/2026-06-22-cloudflare-how-we-found-a-bug-in-the-hyper-http-library — rearchitecture of the binding path exposed a hyper race condition