Skip to content

Commit 7cfa31c

Browse files
committed
Fixing broken links to deleted chapters. Adding public redirect.
1 parent ac0a66d commit 7cfa31c

File tree

13 files changed

+26
-24
lines changed

13 files changed

+26
-24
lines changed

public/_redirects

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,16 +358,17 @@
358358
/support/dns/troubleshooting/why-was-my-domain-deleted-from-cloudflare/ /dns/zone-setups/troubleshooting/domain-deleted/ 301
359359

360360
/durable-objects/examples/durable-object-example/ /durable-objects/examples/durable-object-in-memory-state/ 301
361-
/durable-objects/api/hibernatable-websockets-api/ /durable-objects/api/websockets/ 301
361+
/durable-objects/api/hibernatable-websockets-api/ /durable-objects/best-practices/websockets/ 301
362362
/durable-objects/api/alarms-in-durable-objects/ /durable-objects/api/alarms/ 301
363+
/durable-objects/api/websockets/ /durable-objects/best-practices/websockets/ 301
363364
/durable-objects/platform/data-location/ /durable-objects/reference/data-location/ 301
364365
/durable-objects/platform/environments/ /durable-objects/reference/environments/ 301
365366
/durable-objects/platform/graphql-analytics/ /durable-objects/observability/graphql-analytics/ 301
366367
/durable-objects/platform/troubleshooting/ /durable-objects/observability/troubleshooting/ 301
367368
/durable-objects/learning/ /durable-objects/reference/ 301
368369
/durable-objects/learning/in-memory-state/ /durable-objects/reference/in-memory-state/ 301
369370
/durable-objects/learning/durable-objects-migrations/ /durable-objects/reference/durable-objects-migrations/ 301
370-
/durable-objects/learning/websockets/ /durable-objects/reference/websockets/ 301
371+
/durable-objects/learning/websockets/ /durable-objects/best-practices/websockets/ 301
371372
/durable-objects/examples/durable-object-location-example/ /durable-objects/examples/durable-object-in-memory-state/ 301
372373
/durable-objects/how-to/ /durable-objects/best-practices/ 301
373374
/durable-objects/how-to/access-durable-object-from-a-worker/ /durable-objects/best-practices/access-durable-objects-from-a-worker/ 301
@@ -377,6 +378,7 @@
377378
/durable-objects/reference/error-handling/ /durable-objects/best-practices/error-handling/ 301
378379
/durable-objects/reference/troubleshooting/ /durable-objects/observability/troubleshooting/ 301
379380
/durable-objects/reference/graphql-analytics/ /durable-objects/observability/graphql-analytics/ 301
381+
/durable-objects/reference/websockets/ /durable-objects/best-practices/websockets/ 301
380382
/durable-objects/api/transactional-storage-api/ /durable-objects/api/storage-api/ 301
381383
/durable-objects/platform/changelog/ /durable-objects/changelog/ 301
382384
/durable-objects/glossary/ /durable-objects/reference/glossary/ 301

src/content/docs/durable-objects/api/state.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,11 @@ export class MyDurableObject extends DurableObject {
106106

107107
### `acceptWebSocket`
108108

109-
`acceptWebSocket` is part of the [WebSocket Hibernation API](/durable-objects/reference/websockets/#websocket-hibernation), which allows a Durable Object to be removed from memory to save costs while keeping its WebSockets connected.
109+
`acceptWebSocket` is part of the [WebSocket Hibernation API](/durable-objects/best-practices/websockets/#websocket-hibernation-api), which allows a Durable Object to be removed from memory to save costs while keeping its WebSockets connected.
110110

111111
`acceptWebSocket` adds a WebSocket to the set of WebSockets attached to the Durable Object. Once called, any incoming messages will be delivered by calling the Durable Object's `webSocketMessage` handler, and `webSocketClose` will be invoked upon disconnect. After calling `acceptWebSocket`, the WebSocket is accepted and its `send` and `close` methods can be used.
112112

113-
The [WebSocket Hibernation API](/durable-objects/reference/websockets/#websocket-hibernation) takes the place of the standard [WebSockets API](/workers/runtime-apis/websockets/). Therefore, `ws.accept` must not have been called separately and `ws.addEventListener` method will not receive events as they will instead be delivered to the Durable Object.
113+
The [WebSocket Hibernation API](/durable-objects/best-practices/websockets/#websocket-hibernation-api) takes the place of the standard [WebSockets API](/workers/runtime-apis/websockets/). Therefore, `ws.accept` must not have been called separately and `ws.addEventListener` method will not receive events as they will instead be delivered to the Durable Object.
114114

115115
The WebSocket Hibernation API permits a maximum of 32,768 WebSocket connections per Durable Object, but the CPU and memory usage of a given workload may further limit the practical number of simultaneous connections.
116116

@@ -125,7 +125,7 @@ The WebSocket Hibernation API permits a maximum of 32,768 WebSocket connections
125125

126126
### `getWebSockets`
127127

128-
`getWebSockets` is part of the [WebSocket Hibernation API](/durable-objects/reference/websockets/#websocket-hibernation), which allows a Durable Object to be removed from memory to save costs while keeping its WebSockets connected.
128+
`getWebSockets` is part of the [WebSocket Hibernation API](/durable-objects/best-practices/websockets//#websocket-hibernation-api), which allows a Durable Object to be removed from memory to save costs while keeping its WebSockets connected.
129129

130130
`getWebSockets` returns an `Array<WebSocket>` which is the set of WebSockets attached to the Durable Object. An optional tag argument can be used to filter the list according to tags supplied when calling [`DurableObjectState::acceptWebSocket`](/durable-objects/api/state/#acceptwebsocket).
131131

@@ -145,7 +145,7 @@ Disconnected WebSockets are not returned by this method, but `getWebSockets` may
145145

146146
### `setWebSocketAutoResponse`
147147

148-
`setWebSocketAutoResponse` is part of the [WebSocket Hibernation API](/durable-objects/reference/websockets/#websocket-hibernation), which allows a Durable Object to be removed from memory to save costs while keeping its WebSockets connected.
148+
`setWebSocketAutoResponse` is part of the [WebSocket Hibernation API](/durable-objects/best-practices/websockets/#websocket-hibernation-api), which allows a Durable Object to be removed from memory to save costs while keeping its WebSockets connected.
149149

150150
`setWebSocketAutoResponse` sets an automatic response, auto-response, for the request provided for all WebSockets attached to the Durable Object. If a request is received matching the provided request then the auto-response will be returned without waking WebSockets in hibernation and incurring billable duration charges.
151151

@@ -179,7 +179,7 @@ Disconnected WebSockets are not returned by this method, but `getWebSockets` may
179179

180180
### `getWebSocketAutoResponseTimestamp`
181181

182-
`getWebSocketAutoResponseTimestamp` is part of the [WebSocket Hibernation API](/durable-objects/reference/websockets/#websocket-hibernation), which allows a Durable Object to be removed from memory to save costs while keeping its WebSockets connected.
182+
`getWebSocketAutoResponseTimestamp` is part of the [WebSocket Hibernation API](/durable-objects/best-practices/websockets/#websocket-hibernation-api), which allows a Durable Object to be removed from memory to save costs while keeping its WebSockets connected.
183183

184184
`getWebSocketAutoResponseTimestamp` gets the most recent `Date` on which the given WebSocket sent an auto-response, or null if the given WebSocket never sent an auto-response.
185185

@@ -193,7 +193,7 @@ Disconnected WebSockets are not returned by this method, but `getWebSockets` may
193193

194194
### `setHibernatableWebSocketEventTimeout`
195195

196-
`setHibernatableWebSocketEventTimeout` is part of the [WebSocket Hibernation API](/durable-objects/reference/websockets/#websocket-hibernation), which allows a Durable Object to be removed from memory to save costs while keeping its WebSockets connected.
196+
`setHibernatableWebSocketEventTimeout` is part of the [WebSocket Hibernation API](/durable-objects/best-practices/websockets/#websocket-hibernation-api), which allows a Durable Object to be removed from memory to save costs while keeping its WebSockets connected.
197197

198198
`setHibernatableWebSocketEventTimeout` sets the maximum amount of time in milliseconds that a WebSocket event can run for.
199199

@@ -209,7 +209,7 @@ If no parameter or a parameter of `0` is provided and a timeout has been previou
209209

210210
### `getHibernatableWebSocketEventTimeout`
211211

212-
`getHibernatableWebSocketEventTimeout` is part of the [WebSocket Hibernation API](/durable-objects/reference/websockets/#websocket-hibernation), which allows a Durable Object to be removed from memory to save costs while keeping its WebSockets connected.
212+
`getHibernatableWebSocketEventTimeout` is part of the [WebSocket Hibernation API](/durable-objects/best-practices/websockets/#websocket-hibernation-api), which allows a Durable Object to be removed from memory to save costs while keeping its WebSockets connected.
213213

214214
`getHibernatableWebSocketEventTimeout` gets the currently set hibernatable WebSocket event timeout if one has been set via [`DurableObjectState::setHibernatableWebSocketEventTimeout`](/durable-objects/api/state/#sethibernatablewebsocketeventtimeout).
215215

@@ -223,7 +223,7 @@ If no parameter or a parameter of `0` is provided and a timeout has been previou
223223

224224
### `getTags`
225225

226-
`getTags` is part of the [WebSocket Hibernation API](/durable-objects/reference/websockets/#websocket-hibernation), which allows a Durable Object to be removed from memory to save costs while keeping its WebSockets connected.
226+
`getTags` is part of the [WebSocket Hibernation API](/durable-objects/best-practices/websockets/#websocket-hibernation-api), which allows a Durable Object to be removed from memory to save costs while keeping its WebSockets connected.
227227

228228
`getTags` returns tags associated with a given WebSocket. This method throws an exception if the WebSocket has not been associated with the Durable Object via [`DurableObjectState::acceptWebSocket`](/durable-objects/api/state/#acceptwebsocket).
229229

src/content/docs/durable-objects/best-practices/websockets.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Using WebSockets
33
pcx_content_type: concept
44
sidebar:
5-
order: 4
5+
order: 5
66
---
77

88
import { Tabs, TabItem, GlossaryTooltip } from "~/components";

src/content/docs/durable-objects/examples/use-kv-from-durable-objects.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ description: Read and write to/from KV within a Durable Object
1313

1414
import { GlossaryTooltip } from "~/components";
1515

16-
The following Worker script shows you how to configure a <GlossaryTooltip term="Durable Object">Durable Object</GlossaryTooltip> to read from and/or write to a [Workers KV namespace](/kv/concepts/how-kv-works/). This is useful when using a Durable Object to coordinate between multiple clients, and allows you to serialize writes to KV and/or broadcast a single read from KV to hundreds or thousands of clients connected to a single Durable Object [using WebSockets](/durable-objects/api/websockets/).
16+
The following Worker script shows you how to configure a <GlossaryTooltip term="Durable Object">Durable Object</GlossaryTooltip> to read from and/or write to a [Workers KV namespace](/kv/concepts/how-kv-works/). This is useful when using a Durable Object to coordinate between multiple clients, and allows you to serialize writes to KV and/or broadcast a single read from KV to hundreds or thousands of clients connected to a single Durable Object [using WebSockets](/durable-objects/best-practices/websockets/).
1717

1818
Prerequisites:
1919

src/content/docs/durable-objects/examples/websocket-hibernation-server.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ description: Build a WebSocket server using WebSocket Hibernation on Durable
1515

1616
import { TabItem, Tabs } from "~/components"
1717

18-
This example is similar to the [Build a WebSocket server](/durable-objects/examples/websocket-server/) example, but uses the WebSocket Hibernation API. The WebSocket Hibernation API should be preferred for WebSocket server applications built on Durable Objects, since it significantly decreases duration charge, and provides additional features that pair well with WebSocket applications. For more information, refer to [Use Durable Objects with WebSockets](/durable-objects/reference/websockets/).
18+
This example is similar to the [Build a WebSocket server](/durable-objects/examples/websocket-server/) example, but uses the WebSocket Hibernation API. The WebSocket Hibernation API should be preferred for WebSocket server applications built on Durable Objects, since it significantly decreases duration charge, and provides additional features that pair well with WebSocket applications. For more information, refer to [Use Durable Objects with WebSockets](/durable-objects/best-practices/websockets/).
1919

2020
:::note
2121

src/content/docs/durable-objects/examples/websocket-server.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ description: Build a WebSocket server using Durable Objects and Workers.
1313

1414
import { TabItem, Tabs, GlossaryTooltip } from "~/components"
1515

16-
This example shows how to build a WebSocket server using <GlossaryTooltip term="Durable Object">Durable Objects</GlossaryTooltip> and Workers. The example exposes an endpoint to create a new WebSocket connection. This WebSocket connection echos any message while including the total number of WebSocket connections currently established. For more information, refer to [Use Durable Objects with WebSockets](/durable-objects/reference/websockets/).
16+
This example shows how to build a WebSocket server using <GlossaryTooltip term="Durable Object">Durable Objects</GlossaryTooltip> and Workers. The example exposes an endpoint to create a new WebSocket connection. This WebSocket connection echos any message while including the total number of WebSocket connections currently established. For more information, refer to [Use Durable Objects with WebSockets](/durable-objects/best-practices/websockets/).
1717

1818
:::caution
1919

src/content/docs/durable-objects/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Learn how Durable Objects provide transactional, strongly consistent, and serial
5151

5252
</Feature>
5353

54-
<Feature header="WebSocket Hibernation" href="/durable-objects/reference/websockets/#websocket-hibernation">
54+
<Feature header="WebSocket Hibernation" href="/durable-objects/best-practices/websockets/#websocket-hibernation-api">
5555

5656
Learn how WebSocket Hibernation allows you to manage the connections of multiple clients at scale.
5757

src/content/docs/durable-objects/observability/graphql-analytics.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ Use [GraphQL Introspection](/analytics/graphql-api/features/discovery/introspect
4444

4545
### WebSocket metrics
4646

47-
Durable Objects using [WebSockets](/durable-objects/reference/websockets/) will see request metrics across several GraphQL datasets because WebSockets have different types of requests.
47+
Durable Objects using [WebSockets](/durable-objects/best-practices/websockets/) will see request metrics across several GraphQL datasets because WebSockets have different types of requests.
4848

4949
* Metrics for a WebSocket connection itself is represented in `durableObjectsInvocationsAdaptiveGroups` once the connection closes. Since WebSocket connections are long-lived, connections often do not terminate until the Durable Object terminates.
50-
* Metrics for incoming and outgoing WebSocket messages on a WebSocket connection are available in `durableObjectsPeriodicGroups`. If a WebSocket connection uses [WebSocket Hibernation](/durable-objects/reference/websockets/#websocket-hibernation), incoming WebSocket messages are instead represented in `durableObjectsInvocationsAdaptiveGroups`.
50+
* Metrics for incoming and outgoing WebSocket messages on a WebSocket connection are available in `durableObjectsPeriodicGroups`. If a WebSocket connection uses [WebSocket Hibernation](/durable-objects/best-practices/websockets/#websocket-hibernation-api), incoming WebSocket messages are instead represented in `durableObjectsInvocationsAdaptiveGroups`.
5151

5252
## Example GraphQL query for Durable Objects
5353

src/content/docs/durable-objects/platform/pricing.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { Render } from "~/components"
1717
These examples exclude the costs for the Workers calling the Durable Objects. When modelling the costs of a Durable Object, note that:
1818

1919
* Inactive objects receiving no requests do not incur any duration charges.
20-
* The [WebSocket Hibernation API](/durable-objects/reference/websockets/#websocket-hibernation) can dramatically reduce duration-related charges for Durable Objects communicating with clients over the WebSocket protocol, especially if messages are only transmitted occasionally at sparse intervals.
20+
* The [WebSocket Hibernation API](/durable-objects/best-practices/websockets/#websocket-hibernation-api) can dramatically reduce duration-related charges for Durable Objects communicating with clients over the WebSocket protocol, especially if messages are only transmitted occasionally at sparse intervals.
2121

2222
### Example 1
2323

src/content/docs/workers/examples/websockets.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ WebSockets utilize an event-based system for receiving and sending messages, muc
3030
:::note
3131

3232

33-
If your application needs to coordinate among multiple WebSocket connections, such as a chat room or game match, you will need clients to send messages to a single-point-of-coordination. Durable Objects provide a single-point-of-coordination for Cloudflare Workers, and are often used in parallel with WebSockets to persist state over multiple clients and connections. In this case, refer to [Durable Objects](/durable-objects/) to get started, and prefer using the Durable Objects' extended [WebSockets API](/durable-objects/api/websockets/).
33+
If your application needs to coordinate among multiple WebSocket connections, such as a chat room or game match, you will need clients to send messages to a single-point-of-coordination. Durable Objects provide a single-point-of-coordination for Cloudflare Workers, and are often used in parallel with WebSockets to persist state over multiple clients and connections. In this case, refer to [Durable Objects](/durable-objects/) to get started, and prefer using the Durable Objects' extended [WebSockets API](/durable-objects/best-practices/websockets/).
3434

3535

3636
:::

0 commit comments

Comments
 (0)