Skip to content

Commit 9a03245

Browse files
doc: add instructions for ISR (#34)
Co-authored-by: Dario Piotrowicz <[email protected]>
1 parent b997312 commit 9a03245

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

packages/cloudflare/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,25 @@ You can use [`create-next-app`](https://nextjs.org/docs/pages/api-reference/cli/
3030
experimental_assets = { directory = ".worker-next/assets", binding = "ASSETS" }
3131
```
3232

33+
You can enable Incremental Static Regeneration ([ISR](https://nextjs.org/docs/app/building-your-application/data-fetching/incremental-static-regeneration)) by adding a KV binding named `NEXT_CACHE_WORKERS_KV` to your `wrangler.toml`:
34+
35+
- Create the binding
36+
37+
```bash
38+
npx wrangler kv namespace create NEXT_CACHE_WORKERS_KV
39+
```
40+
41+
- Paste the snippet to your `wrangler.toml`:
42+
43+
```bash
44+
[[kv_namespaces]]
45+
binding = "NEXT_CACHE_WORKERS_KV"
46+
id = "..."
47+
```
48+
49+
> [!WARNING]
50+
> The current support for ISR is limited.
51+
3352
## Local development
3453

3554
- you can use the regular `next` CLI to start the Next.js dev server:

0 commit comments

Comments
 (0)