This is an image proxy that saves you bandwidth by caching your images with Cloudflare workers. Works with Imgix, Cloudinary, and other image providers.
-
Clone this repository:
git clone https://github.com/wilsonhou/cloudflare-image-proxy.git
-
Install dependencies:
pnpm install
-
Configure the worker:
- Copy
wrangler.toml.exampletowrangler.toml. - Replace
PROVIDER_URLinwrangler.tomlwith your image provider's domain, e.g.,"<your-domain>.imgix.net"or"https://res.cloudinary.com/<your-cloudinary-account>/image".
- Copy
-
Develop and test the worker:
pnpm run dev
-
Deploy the worker to Cloudflare:
pnpm run deploy
Inspired by Wes Bos's cloudflare-cloudinary-proxy.
Licensed under the MIT License.