From 5416aed54ba8c62dbd0355c42cb62843ac1b3ab2 Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Wed, 25 Sep 2024 16:48:45 +0200 Subject: [PATCH 1/2] doc: add instructions for ISR --- packages/cloudflare/README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/packages/cloudflare/README.md b/packages/cloudflare/README.md index 79be9991..1090c675 100644 --- a/packages/cloudflare/README.md +++ b/packages/cloudflare/README.md @@ -30,6 +30,25 @@ You can use [`create-next-app`](https://nextjs.org/docs/pages/api-reference/cli/ experimental_assets = { directory = ".worker-next/assets", binding = "ASSETS" } ``` +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`: + +- Create the binding + + ```bash + npx wrangler kv namespace create NEXT_CACHE_WORKERS_KV + ``` + +- Paste the snippet to your `wrangler.toml`: + + ```bash + [[kv_namespaces]] + binding = "NEXT_CACHE_WORKERS_KV" + id = "..." + ``` + +> **Note** +> The current support for ISR is limited. + ## Local development - you can use the regular `next` CLI to start the Next.js dev server: From 95a567e21439238a3f058410d7a7caf5567e62f6 Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Wed, 25 Sep 2024 18:46:58 +0200 Subject: [PATCH 2/2] Update packages/cloudflare/README.md Co-authored-by: Dario Piotrowicz --- packages/cloudflare/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cloudflare/README.md b/packages/cloudflare/README.md index 1090c675..d0dd6e27 100644 --- a/packages/cloudflare/README.md +++ b/packages/cloudflare/README.md @@ -46,7 +46,7 @@ You can enable Incremental Static Regeneration ([ISR](https://nextjs.org/docs/ap id = "..." ``` -> **Note** +> [!WARNING] > The current support for ISR is limited. ## Local development