On this page · 12 sections
- What changed on 25 November
- Turn it on in Wrangler or the Cloudflare CLI
- Allowed origins: the setting most likely to break images
- Overriding zone settings on a custom domain
- Testing locally, on Previews and on staging
- What a pre-launch image test can and cannot prove
- What it costs, including staging
- Should you use URLs, the binding or Polish?
- A one-week adoption plan
- India-specific considerations
- How eCorpIT can help
- References
Summary. On 25 November 2026 Cloudflare made Images transformation URLs, the /cdn-cgi/image/ kind, work on workers.dev subdomains and in local development through a new per-Worker setting. Until then a Worker could only serve them through a connected custom domain whose zone had the URL interface switched on. You now set images.url_transformations in Wrangler, or images.urlTransformations in cloudflare.config.ts, with up to 10 allowed origins, and on custom domains the Worker's setting overrides the zone's. Three details decide whether it helps you. Deploying the setting needs Wrangler 4.168.0 and local support needs 4.170.0, published on 1 December. Once you add an allowlist, your own hostnames must be on it or relative images fail in production. And branch Previews made with wrangler preview do not apply the setting, so a staging Worker is the place to test. Local use is free. Deployed use counts towards 5,000 free unique transformations a month, then costs $0.50 per 1,000 on the Paid plan. Our verdict: adopt it for staging now, and treat local output as a markup check, not a performance test.
About this article. This is for front-end and platform engineers, and the leads who sign off launches, in India, the UK, the US and elsewhere, who run sites on Cloudflare Workers. On 3 December 2026 we checked every setting, limit, version and price here against Cloudflare's changelog, its Images, Workers and Cloudflare CLI documentation, the Wrangler release notes and merged pull requests, the npm registry, web.dev and the European Central Bank's reference rates. We read the documentation and source code; we did not benchmark the feature. Cloudflare changes its products and prices, and no vendor paid for inclusion. Researched with AI assistance and checked against the primary sources listed in the references.
What changed on 25 November
A transformation URL puts the resize and format instructions in the path, so /cdn-cgi/image/format=auto,width=400/image.png asks Cloudflare for a 400-pixel-wide copy in the best format the browser accepts. Cloudflare fetches the source, transforms it, caches the result and serves later requests from the edge.
The catch was where those URLs worked. They were a zone feature, so a Worker that lived only on workers.dev, or on a laptop, could not serve them. The alternative was cf.image options on a fetch() call in Worker code, which are available on workers.dev. Cloudflare's own Next.js example still returns the untransformed source whenever NODE_ENV is development, so anyone who copied it sees originals on localhost and the real image pipeline only after deployment.
The new setting belongs to the Worker. It applies to the deployed Worker and to local development, and it does not need an IMAGES binding.
| Where the image URL is requested | Before 25 November | Now |
|---|---|---|
| Custom domain on your zone | Worked if the zone setting was on | Works; the Worker setting wins if present |
| Worker on workers.dev | Not available | Works once enabled on the Worker |
| Version URL of a Worker | Not available | Works, using the deployed settings |
| Local dev server | Not available | Works with a low-fidelity mock |
| Branch Preview from wrangler preview | Not available | Still not applied |
| Site on a pages.dev address | Custom domain advised | No change announced |
The first four rows come from the changelog and the URL documentation. The Preview row comes from the pull request that added the setting, and the last from Cloudflare's troubleshooting page, which tells Pages users who hit error 9524 on a pages.dev URL to use a custom domain.
Turn it on in Wrangler or the Cloudflare CLI
Cloudflare recommends its cf CLI for new projects and the tool you already use for existing ones. In wrangler.jsonc, add this block to your existing configuration:
{
"name": "image-app",
"images": {
"url_transformations": {
"enabled": true
}
}
}
With no allowlist, the Worker accepts source images from its own zone only. For the Cloudflare CLI, the same setting sits on the Worker in cloudflare.config.ts, and an Images binding, if you have one, stays under env:
import { defineConfig } from "cf/config";
export default defineConfig({
worker: {
name: "image-app",
compatibilityDate: "2026-12-03",
images: {
urlTransformations: {
enabled: true,
allowedOrigins: [
"images.example.com",
"image-app.<YOUR_SUBDOMAIN>.workers.dev",
],
},
},
},
});
Then run wrangler deploy or cf deploy. A REST endpoint does the same job for teams that manage settings outside a repository; the Cloudflare dashboard has no control for the Worker-level allowlist.
Check your Wrangler version first
The feature arrived in three releases, which the changelog entry does not list. An earlier version can accept the setting and still not act on it.
| Wrangler version | Published | What it added |
|---|---|---|
| 4.166.0 | 20 November 2026 | Accepts and validates the setting, nothing more |
| 4.168.0 | 24 November 2026 | Applies it on wrangler deploy and versions deploy |
| 4.170.0 | 1 December 2026 | Serves the URLs in local development |
The practical minimum is 4.170.0. Two other tools lagged on npm on 3 December, because each pins its own copy of Miniflare, the local simulator that does the work:
- Cloudflare CLI. The newest
cfrelease, 1.0.0-rc.7 of 30 November, pins a Miniflare build published on 29 November, the day before the local code was merged. Cloudflare documentscf devas supported, so check that a local image URL returns a resized image before your team relies on it.
- Cloudflare Vite plugin. The stable release, 1.70.2 of 25 November, pins Wrangler 4.168.0 and an older Miniflare. The first build that pins the same Miniflare as Wrangler 4.170.0 is the pre-release 2.0.0-rc.8 of 1 December. If
vite devignores the setting, that is the likely reason.
Five deployment behaviours to know
- Removing the block does not turn it off. Deployed settings stay active until you change them. To disable the feature, deploy with
enabledset tofalse.
- Named environments start empty.
env.stagingdoes not inherit the top-level setting, so repeat it there.
- Uploading a version does not change it.
wrangler versions uploadleaves the setting alone, and Version URLs use whatever is currently deployed.
- It is applied last. Wrangler sets it after the Worker and its triggers are live. If that step fails, the command fails although the new code is already serving, so a red pipeline does not mean nothing shipped.
- Routes must match. A route of
example.com/*covers/cdn-cgi/image/, butexample.com/foo/*does not.
Allowed origins: the setting most likely to break images
The allowlist looks like a list of extra hosts. It is not. When you set allowed_origins, only the listed origins are accepted, and the Worker's own zone is no longer implied. On 3 December the published cf configuration reference still described the entries as additions to the Worker's own zone, wording Cloudflare had already corrected in its code on 30 November.
So if you add a CDN host and forget your own, a relative source such as /images/hero.jpg is rejected in production. A Worker that answers on both workers.dev and a custom domain needs both hostnames in the list.
| Entry | What it accepts | Watch for |
|---|---|---|
| b.com | That exact hostname, every path | Not media.b.com |
| *.b.com | b.com and all its subdomains | Wider than most teams need |
| b.com/themes | Paths that start with /themes | Prefix match only |
| * | Any public image on the internet | Must be the only entry; others can spend your quota |
The rules are the same for zones and Workers, and a Worker list holds at most 10 entries. Two points for security review:
- Redirects are followed. In production Cloudflare checks only the first source URL, then follows redirects even to hosts you did not allow. List only hosts whose redirects you trust.
- The list covers URLs only. It does not restrict the Images binding or
cf.imageoptions on afetch()call, so code paths that use those need their own checks.
Version URLs need thought too. Each has its own hostname under your workers.dev subdomain, so by the documented rule a strict list that names only the main hostname would reject relative sources there. If every image is on your own zone, leave the allowlist out. If you need one, *.<YOUR_SUBDOMAIN>.workers.dev should cover version hostnames, at the price of trusting every Worker in the account.
Overriding zone settings on a custom domain
For requests a Worker handles on a custom domain, the Worker's configuration, when present, always beats the zone's, and its list replaces the zone's list rather than merging with it. Three useful patterns:
- Restrict one app. A marketing zone that allows several image hosts can carry a checkout Worker that accepts only its own hostname.
- Opt one Worker out. Deploy
enabled: falseon a Worker that should never transform images; that overrides a zone setting that is on.
- Keep settings with the code. The allowlist change sits in the same pull request as the page that needs it.
It also creates one trap. Editing the zone allowlist in the dashboard has no effect on paths served by a Worker with its own setting. Write down which scope owns each hostname.
Testing locally, on Previews and on staging
Local development checks markup, not quality
With the setting on, start npx wrangler dev and request an image the way a modern browser would:
curl -s -o /dev/null -D - \
-H "Accept: image/avif,image/webp,*/*" \
"http://localhost:8787/cdn-cgi/image/width=800,format=auto/images/hero.jpg"
You want an image content type that matches the Accept header. The local server negotiates format=auto from that header, trying AVIF first and then WebP.
Know what the mock leaves out. It handles resizing, rotation, format conversion and a small set of other options, and Cloudflare says to deploy for complete production behaviour. The merged code shows that it ignores unsupported options instead of failing, and that it ignores width=auto because that relies on client hints. So a blur or sharpen option that does nothing on your laptop is not a bug in your URL.
The upgrade also changes behaviour. Since 4.170.0, local requests under /cdn-cgi/image/ no longer reach your Worker code, so any hand-written local shim stops being called. They return 404 when the setting is off, and 403 when the source is not allowed. The documentation says relative sources are always accepted locally, but the merged code checks them against your allowlist when the Worker has a route configured, so a local 403 may be an early warning of a production failure. Redirects are stricter locally too: the mock checks every hop against the allowlist, while production checks only the first URL.
Branch Previews do not apply the setting
Cloudflare recommends Worker Previews for branches and pull requests. But url_transformations cannot go in the previews block, and the engineer who added it states that deployments created with wrangler preview do not apply it; only the Images binding is supported there. If reviewers see broken images on a Preview link, check this first.
Version URLs do work, but they run against production resources and stop working when the version is deleted. Our guide to Cloudflare's 30-day version retention and Worker Previews explains which link types survive.
A staging Worker is the right test bed
A named Wrangler environment deploys as a separate Worker with its own workers.dev address and its own image settings:
{
"name": "image-app",
"images": {
"url_transformations": { "enabled": true }
},
"env": {
"staging": {
"name": "image-app-staging",
"workers_dev": true,
"images": {
"url_transformations": {
"enabled": true,
"allowed_origins": [
"image-app-staging.<YOUR_SUBDOMAIN>.workers.dev",
"images.example.com"
]
}
}
}
}
}
Deploy it with npx wrangler deploy --env staging. Settle three things before you share the link. A workers.dev address is public unless you put Cloudflare Access in front of it. If you do, test the images while signed in: Cloudflare fetches sources without cookies or authorisation headers, and lists a login page returned in place of an image as a cause of error 9412. We found no page on how Access treats relative sources. Finally, every workers.dev request passes a Browser Integrity Check you cannot turn off, which returns error 1010 to some default library user agents, so give your image test scripts a descriptive User-Agent. If you use Access across the account, read our note on gaps in protecting all Workers as well.
What a pre-launch image test can and cannot prove
A staging Worker lets you see real production transforms before DNS moves. Check four things.
- The format you actually get. AVIF encoding can be an order of magnitude slower than other formats, so Cloudflare falls back to WebP or JPEG when an image is too large to encode quickly. The limits page lists a 1,200-pixel dimension limit for AVIF, so a 1,600-pixel hero may well arrive as WebP. Record the content type at each width.
- The cache header on your sources. If a source's
max-ageis under 3,600 seconds, Cloudflare optimises the image with reduced effort and adds acache-control is too restrictivewarning header. Files served as Workers static assets default tomax-age=0, must-revalidate, which falls under that threshold.
- The breakpoints in your markup. Use
srcsetwith width descriptors and asizesattribute so that phones do not download desktop files.
- Failure behaviour. Request a missing image and a blocked host, and read the
Cf-Resizedheader for the error code. Addingonerror=redirectsends visitors to the original, but only when the source is in the same zone.
For the second point, a _headers file in your static assets directory overrides the default, but not for responses your Worker code generates; set the header in code there. Use versioned file names so that a longer lifetime never serves an old picture:
/images/*
Cache-Control: public, max-age=604800
What staging cannot prove is your Largest Contentful Paint score. Google's target is 2.5 seconds or less at the 75th percentile of real page loads, split by mobile and desktop. Smaller images shorten only one of the four parts of LCP, and web.dev says load duration tends not to be a significant bottleneck for most sites. Cloudflare treats workers.dev as a Free website meant for personal or hobby projects, so your zone's caching and performance rules are not in the picture. Use field data after launch for LCP. Our guide to AVIF in Cloudflare Polish covers the zone-wide alternative that needs no URL changes, and our Core Web Vitals article covers the measurement side.
What it costs, including staging
A unique transformation is one source image with one set of options in a calendar month. Repeat requests are free, and format and quality are ignored when counting, so testing AVIF against WebP or quality 60 against 85 adds nothing. The Free plan stops new transformations at 5,000 a month with error 9422, while cached ones keep working. The Paid plan includes the first 5,000 and then charges $0.50 per 1,000.
An illustrative shop has 1,200 product images at 6 widths, all held outside Cloudflare Images. Rupee figures use ₹92.99 per US dollar, crossed from the ECB rates of 2 December 2026 and rounded to two decimals.
| Month | Unique transformations | Billable on Paid | Cost |
|---|---|---|---|
| Production only | 1,200 x 6 = 7,200 | 2,200 | $1.10 (₹102.29) |
| Production plus a full staging crawl | 14,400 | 9,400 | $4.70 (₹437.05) |
| Open allowlist, 1 million distinct requests by others | 1,000,000 | 995,000 | $497.50 (₹46,262.53) |
The second row assumes that staging copies on another hostname count as different source images, which is the safe way to budget. On the Free plan either of the first two rows goes past 5,000, so a full staging crawl could use up the month's allowance before launch day. Crawl a sample of 50 products (300 transformations) instead. The third row is why ["*"] should be rare: Cloudflare itself warns that it lets third parties request transformations through your URL interface. A Workers spending limit counts only request and CPU charges and does not apply to other products' charges, so it will not cap an Images bill. Our spending limits guide explains that boundary.
Should you use URLs, the binding or Polish?
| Option | Best for | Allowlist applies | Cached automatically |
|---|---|---|---|
| Transformation URLs | Images in HTML and srcset | Yes | Yes |
| cf.image on fetch | Custom URL schemes and hidden origins | No | Yes |
| Images binding | Raw bytes, uploads, private R2 objects, watermarks | No | No, enable Workers Cache |
| Polish | Existing images at sensible sizes, Pro plan and above | Not applicable | Yes |
The comparison draws on the URL, source origin, fetch, binding and Polish pages. If the page is HTML and the images have public addresses, transformation URLs are the simplest choice, and they now work the same way on staging and in production. If your framework already uses the binding, as Astro's Cloudflare adapter does by default, you gain little by switching. Still choosing a framework? Start with our Astro 6 and Next.js 16 comparison.
A one-week adoption plan
- Day 1. Upgrade the project's Wrangler dependency to 4.170.0 or later, check your Vite plugin version, and search the code for development-only image bypasses.
- Day 2. Enable the setting, remove the bypass, and fix any local 404 or 403.
- Day 3. Create the staging environment with its own image block. Add hosts only if you need them, and include your own hostnames.
- Day 4. Fix cache headers on source images, then record format and bytes at each breakpoint for your 10 heaviest pages.
- Day 5. Deploy to production, confirm which scope owns each custom domain, and record how to switch the feature off.
India-specific considerations
Agencies in India often build on a client's behalf weeks before the client hands over DNS. This change helps most there: the client can review correctly sized images on a workers.dev address with no domain on Cloudflare at all. Put Access on that address if the catalogue or prices are confidential, after the image check described above. For audiences on Android phones and mobile data, test the widths from 320 to about 1,080 pixels first: a 360-pixel-wide layout on a screen with three device pixels per CSS pixel asks for 1,080. Use sample pictures on staging, not customer photographs.
How eCorpIT can help
eCorpIT is a Gurugram-based technology organisation, founded in 2021, assessed at CMMI Level 5 and MSME certified, with senior-led engineering teams working across AWS, Microsoft and Google platforms. Our application development services team can move your image handling to transformation URLs, set up a protected staging Worker and check formats, breakpoints and cache headers before launch. Talk to us at /contact-us/.
Last updated: 3 December 2026.