Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion src/content/docs/en/reference/modules/astro-app.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ import type {

<p>

**Type:** `{addCookieHeader?: boolean; clientAddress?: string; locals?: object; prerenderedErrorPageFetch?: (url: ErrorPagePath) => Promise<Response>; routeData?: RouteData;}`
**Type:** `{addCookieHeader?: boolean; clientAddress?: string; locals?: object; prerenderedErrorPageFetch?: (url: ErrorPagePath) => Promise<Response>; waitUntil?: (promise: Promise<unknown>) => void; routeData?: RouteData;}`
</p>

Describes the options for controlling the routes rendering.
Expand Down Expand Up @@ -346,6 +346,28 @@ return app.render(request, {

If not provided, Astro will fallback to its default behavior for fetching error pages.

#### `RenderOptions.waitUntil`
Comment thread
ArmandPhilippot marked this conversation as resolved.
Outdated

<p>

**Type:** `(promise: Promise<unknown>) => void`<br />
<Since v="6.2.0" />
</p>

An optional runtime hook for background work after the response is sent.

Adapters can pass this through to let runtime cache providers schedule work such as cache writes or stale-while-revalidate without blocking the response path.

The following example forwards a runtime's `waitUntil` implementation to [`app.render()`](#apprender):
Comment thread
ArmandPhilippot marked this conversation as resolved.
Outdated

```js "waitUntil"
return app.render(request, {
routeData,
locals,
waitUntil,
});
```
Comment thread
ArmandPhilippot marked this conversation as resolved.
Outdated

#### `RenderOptions.routeData`

<p>
Expand Down
Loading