Skip to content
All projects

Image CDN Proxy

Cloudflare Worker that resizes and re-encodes images on the fly, with a signed-URL allowlist.

cloudflareworkersimagesperformance

Static exports lose Next's image optimizer. This puts it back at the edge without a server.

How it works

Requests hit a Worker that fetches the origin image, resizes to the requested width, converts to AVIF or WebP based on Accept, and caches the result at the edge. Subsequent requests never touch the origin.

Guarding it

An open resizing endpoint is a bandwidth bill waiting to happen. URLs are HMAC-signed with the width baked into the signature, so only sizes your app actually requests can be generated.

Numbers

A 2.4 MB hero photo comes back as 180 KB of AVIF. Cold requests add roughly 40ms; warm ones serve from cache.