Skip to content

Commit 2486db5

Browse files
committed
Moving build a counter into a separate example folder.
1 parent 42e8b88 commit 2486db5

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed
File renamed without changes.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: Key-value storage examples
3+
pcx_content_type: navigation
4+
sidebar:
5+
order: 90
6+
group:
7+
hideIndex: true
8+
---
9+
10+
import { ListExamples, GlossaryTooltip } from "~/components";
11+
12+
Explore the following <GlossaryTooltip term="code example">examples</GlossaryTooltip> for Durable Objects.
13+
14+
<ListExamples />

src/content/docs/durable-objects/features/create-durable-object-stubs-and-send-requests.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ With RPC, the `DurableObject` superclass defines `ctx` and `env` as class proper
2525

2626
:::
2727

28-
Refer to [Build a Counter](/durable-objects/examples/build-a-counter/) for a complete example.
28+
Refer to [Build a Counter](/durable-objects/examples/kv-storage-examples/build-a-counter/) for a complete example.
2929

3030
### Invoking the `fetch` handler
3131

src/content/docs/durable-objects/reference/in-memory-state.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ In the example above, using a global variable `value` instead of the instance va
3939

4040
:::note[Built-in caching]
4141

42-
The Durable Object's storage has a built-in in-memory cache of its own. If you use `get()` to retrieve a value that was read or written recently, the result will be instantly returned from cache. Instead of writing initialization code like above, you could use `get("value")` whenever you need it, and rely on the built-in cache to make this fast. Refer to the [Build a counter example](/durable-objects/examples/build-a-counter/) to learn more about this approach.
42+
The Durable Object's storage has a built-in in-memory cache of its own. If you use `get()` to retrieve a value that was read or written recently, the result will be instantly returned from cache. Instead of writing initialization code like above, you could use `get("value")` whenever you need it, and rely on the built-in cache to make this fast. Refer to the [Build a counter example](/durable-objects/examples/kv-storage-examples/build-a-counter/) to learn more about this approach.
4343

4444
However, in applications with more complex state, explicitly storing state in your Object may be easier than making Storage API calls on every access. Depending on the configuration of your project, write your code in the way that is easiest for you.
4545

0 commit comments

Comments
 (0)