Cloudflare Demo Shop

Image Optimization

Resize, recompress, and reformat images on the fly. Serve WebP and AVIF to browsers that support them, smaller variants to mobile — all via URL parameters or a Worker.

Why are images still the slowest thing on your page?

Images are typically 60–80% of total page weight. Most teams upload a single high-resolution JPEG and let the browser deal with it — wasting bandwidth on mobile, missing out on AVIF/WebP, and never serving variants sized for the actual viewport. Building an offline pipeline to generate dozens of variants per asset is real engineering work; storing them all costs real money. The result: pages feel slow, especially on flaky mobile networks.

How it fits together

Diagram coming soon

Architecture diagram for this solution will be added here.

How Cloudflare solves it

Common questions

Will <code>format=auto</code> break my older browsers?
No — Cloudflare checks the Accept header. Browsers that don't support AVIF get WebP, ones that don't support either get the original format.
Does this work for images I don't control (third-party CDNs)?
Image Resizing requires the image to be on a domain proxied through Cloudflare, or fetched by a Worker. You can't directly transform an image hosted on another vendor's CDN — but you can fetch it via a Worker, transform it, and serve from your domain.
What about animated GIFs and SVGs?
Animated GIFs can be converted to MP4 or WebM for huge size savings. SVGs are passed through (already vector). The transform pipeline handles JPEG, PNG, WebP, AVIF, GIF, and TIFF inputs.
How does this differ from Cloudflare Images (the paid product)?
Image Resizing/Polish transforms images that already live on your origin. Cloudflare Images is a managed store-plus-serve product that hosts your masters and serves variants — useful when you don't want to manage image storage yourself.

Try it live

Demo coming soon

An interactive demo for Image Optimization is being built. In the meantime, check the "Dive Deeper" section below for the official docs and product blogs.

Docs & blogs

← Back to all solutions