You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/workers/runtime-apis/streams/index.mdx
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ The [Streams API](https://developer.mozilla.org/en-US/docs/Web/API/Streams_API)
15
15
16
16
<DirectoryListing />
17
17
18
-
Workers do not need to prepare an entire response body before delivering it to `event.respondWith()`. You can use [`TransformStream`](/workers/runtime-apis/streams/transformstream/) to stream a response body after sending the front matter (that is, HTTP status line and headers). This allows you to minimize:
18
+
Workers do not need to prepare an entire response body before returning a `Response`. You can use a [`ReadableStream`](/workers/runtime-apis/streams/readablestream/) to stream a response body after sending the front matter (that is, HTTP status line and headers). This allows you to minimize:
19
19
20
20
* The visitor’s time-to-first-byte.
21
21
* The buffering done in the Worker.
@@ -39,7 +39,7 @@ The worker can create a `Response` object using a `ReadableStream` as the body.
39
39
exportdefault {
40
40
asyncfetch(request, env, ctx) {
41
41
// Fetch from origin server.
42
-
let response =awaitfetch(request);
42
+
constresponse=awaitfetch(request);
43
43
44
44
// ... and deliver our Response while that’s running.
0 commit comments