What
Cloudflare's script-upload metadata now accepts a top-level exports map whose type: worker entries carry per-entrypoint cache configuration, overriding the worker-wide cache_options for a single entrypoint. Alchemy currently exposes only the worker-wide cache prop (WorkerCache = PutScriptMetadata.cacheOptions), and its exports prop is internal and admits only Durable Object and Workflow entries, so the documented gateway pattern (cache disabled on the default entrypoint, enabled on a named inner entrypoint) cannot be expressed.
Evidence
- The live Cloudflare OpenAPI for
PUT /accounts/{account_id}/workers/scripts/{script_name} (and the versions create endpoint, and /settings) documents metadata exports, with the example {"Admin": {"cache": {"enabled": true}, "type": "worker"}, "default": {"cache": {"enabled": false}, "type": "worker"}} and the description "Worker entrypoint entries (type: worker) carry cache configuration for that entrypoint."
- Wrangler 4.112 sends it: its upload form builds
metadata.exports from config (createWorkerUploadForm), and wrangler/config-schema.json defines WorkerEntrypointExport = { type: "worker", cache: { enabled: boolean } }.
@distilled.cloud/cloudflare@1.0.0-rc.4 already models per-entrypoint cache settings on the GET/response side, but PutScriptMetadata (and the versions-create metadata) has no exports field, so the value cannot be sent. The checked-in spec snapshot for the scripts update page predates the field: it references "a type: worker entry in the exports map" in the cache_options prose without defining the map itself; the live index.md for that page defines it fully.
- Cloudflare's own Workers Caching docs recommend exactly this shape for gateways: https://developers.cloudflare.com/workers/cache/configuration/#per-entrypoint-caching
Why we need it
We run the documented gateway pattern in production: an authenticating default entrypoint that must execute on every request, and a cache-enabled named entrypoint serving published content. Worker-wide cache: { enabled: true } works (we ship it today, with every non-cached lane pinned no-store), but it also turns every ctx.exports loopback on the uncached lanes into billable requests and leaves the gateway behind an unnecessary cache layer. Per-entrypoint enablement is the intended fix and only the provider surface is missing.
Suggested shape
- distilled: refresh the workers scripts spec pages and regenerate, so
PutScriptMetadata (and the versions-create metadata) gains exports?: Record<string, ...> including worker entries with cache?: { enabled: boolean }.
- alchemy: accept worker-entrypoint entries in the
Worker resource (either by widening exports with a WorkerEntrypointExport mirroring wrangler's config schema, or a dedicated prop), merge them with the auto-populated Durable Object and Workflow exports, and pass them through both upload paths.
Happy to send the alchemy-side PR once the SDK field exists; the spec regen seemed better left to your pipeline than to a drive-by snapshot refresh.
What
Cloudflare's script-upload metadata now accepts a top-level
exportsmap whosetype: workerentries carry per-entrypoint cache configuration, overriding the worker-widecache_optionsfor a single entrypoint. Alchemy currently exposes only the worker-widecacheprop (WorkerCache=PutScriptMetadata.cacheOptions), and itsexportsprop is internal and admits only Durable Object and Workflow entries, so the documented gateway pattern (cache disabled on the default entrypoint, enabled on a named inner entrypoint) cannot be expressed.Evidence
PUT /accounts/{account_id}/workers/scripts/{script_name}(and the versions create endpoint, and/settings) documents metadataexports, with the example{"Admin": {"cache": {"enabled": true}, "type": "worker"}, "default": {"cache": {"enabled": false}, "type": "worker"}}and the description "Worker entrypoint entries (type: worker) carry cache configuration for that entrypoint."metadata.exportsfrom config (createWorkerUploadForm), andwrangler/config-schema.jsondefinesWorkerEntrypointExport = { type: "worker", cache: { enabled: boolean } }.@distilled.cloud/cloudflare@1.0.0-rc.4already models per-entrypoint cache settings on the GET/response side, butPutScriptMetadata(and the versions-create metadata) has noexportsfield, so the value cannot be sent. The checked-in spec snapshot for the scripts update page predates the field: it references "atype: workerentry in theexportsmap" in thecache_optionsprose without defining the map itself; the liveindex.mdfor that page defines it fully.Why we need it
We run the documented gateway pattern in production: an authenticating default entrypoint that must execute on every request, and a cache-enabled named entrypoint serving published content. Worker-wide
cache: { enabled: true }works (we ship it today, with every non-cached lane pinned no-store), but it also turns everyctx.exportsloopback on the uncached lanes into billable requests and leaves the gateway behind an unnecessary cache layer. Per-entrypoint enablement is the intended fix and only the provider surface is missing.Suggested shape
PutScriptMetadata(and the versions-create metadata) gainsexports?: Record<string, ...>including worker entries withcache?: { enabled: boolean }.Workerresource (either by wideningexportswith aWorkerEntrypointExportmirroring wrangler's config schema, or a dedicated prop), merge them with the auto-populated Durable Object and Workflow exports, and pass them through both upload paths.Happy to send the alchemy-side PR once the SDK field exists; the spec regen seemed better left to your pipeline than to a drive-by snapshot refresh.