Astro Info
Astro v6.1.1
Vite v7.3.1
Node v24.14.0
System macOS (arm64)
Package Manager npm
Output server
Adapter @astrojs/cloudflare (v13.1.4)
Integrations none
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
experimental.cache: waitUntil missing from CacheProvider.onRequest context when using the Cloudflare adapter.
The docs define onRequest context as:
context: { request: Request; url: URL; waitUntil?: (promise: Promise<unknown>) => void }
But waitUntil is missing in both the type and at runtime when using the Cloudflare adapter.
dist/core/cache/types.d.ts — waitUntil is not in the type:
onRequest?(context: {
request: Request;
url: URL;
}, next: MiddlewareNext): Promise<Response>;
Runtime — typeof context.waitUntil is "undefined" inside a custom provider's onRequest.
Without it, cache writes in Cloudflare Workers must be awaited before the response is sent, adding latency on every cache miss. The correct pattern — context.waitUntil(cache.put(...)) — is currently broken.
What's the expected result?
context.waitUntil should be available, matching the documented signature, so that cache writes can be handed off as background work.
Link to Minimal Reproducible Example
https://github.com/edmelly/astro-playground
Participation
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
experimental.cache:waitUntilmissing fromCacheProvider.onRequestcontext when using the Cloudflare adapter.The docs define
onRequestcontext as:But
waitUntilis missing in both the type and at runtime when using the Cloudflare adapter.dist/core/cache/types.d.ts—waitUntilis not in the type:Runtime —
typeof context.waitUntilis"undefined"inside a custom provider'sonRequest.Without it, cache writes in Cloudflare Workers must be
awaited before the response is sent, adding latency on every cache miss. The correct pattern —context.waitUntil(cache.put(...))— is currently broken.What's the expected result?
context.waitUntilshould be available, matching the documented signature, so that cache writes can be handed off as background work.Link to Minimal Reproducible Example
https://github.com/edmelly/astro-playground
Participation