TIL: Enabling Workers Cache through Nitro without a native option
Nitro forwards arbitrary keys into the generated wrangler config, so you can turn on Cloudflare Workers Cache with a single line even though there is no dedicated Nitro option for it.
Cloudflare shipped Workers Cache to GA in July 2026: a tiered, regional cache that sits in front of a Worker and is driven entirely by standard Cache-Control headers. Cache hits are billed at the request rate with no CPU charge, and it works on workers.dev, preview URLs, and service bindings.
The catch: when you deploy a Nuxt app through Nitro's cloudflare_module preset, there is no nitro.cloudflare.cache option. I went looking for one and it does not exist.
The one thing worth knowing
Nitro builds the final wrangler.json by deep-merging config with defu, and the wrangler block has no allowlist. Any key you put there is passed straight through to the generated config.
So the entire setup is one nested block:
export default defineNuxtConfig({
nitro: {
preset: 'cloudflare_module',
cloudflare: {
deployConfig: true,
wrangler: {
cache: {
enabled: true,
},
},
},
},
});
That generates .output/server/wrangler.json with cache included. Add Cache-Control headers to the responses you want cached and you are done.
Two things that will bite you
Workers Cache is Worker-only. Cloudflare Pages has an explicit allowlist of supported config fields, and cache is not on it. Deploying a Pages project with a cache key fails outright with Configuration file for Pages projects does not support "cache". This is one more reason the Pages-to-Workers migration is worth doing.
Second, mind your Wrangler version. The basic cache: { enabled: true } block landed in Wrangler 4.89.0. Per-entrypoint cache control through the exports map needs 4.107.0 or newer. On older Wrangler the extra keys are silently dropped with a warning rather than an error, so it looks like it worked when it did not.