Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions pages/cloudflare/caching.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The ISR adapter for Cloudflare uses [Workers KV](https://developers.cloudflare.c
npx wrangler@latest kv namespace create <YOUR_NAMESPACE_NAME>
```

##### 2. Add the KV namespace to your Worker
##### 2. Add the KV namespace and Service Binding to your Worker

The binding name used in your app's worker is `NEXT_CACHE_WORKERS_KV`.

Expand All @@ -44,6 +44,12 @@ The binding name used in your app's worker is `NEXT_CACHE_WORKERS_KV`.
"id": "<BINDING_ID>",
},
],
"services": [
{
"binding": "NEXT_CACHE_REVALIDATION_WORKER",
"service": "<WORKER_NAME>",
},
],
}
```

Expand Down Expand Up @@ -85,7 +91,7 @@ To use on-demand revalidation, you should also follow the [ISR setup steps](#inc
If your app **only** uses the pages router, it does not need to have a tag cache and should skip this step.
</Callout>

##### 1. Create a D1 database
##### 1. Create a D1 database and Service Binding

The binding name used in your app's worker is `NEXT_CACHE_D1`.

Expand All @@ -100,6 +106,12 @@ The binding name used in your app's worker is `NEXT_CACHE_D1`.
"database_name": "<DATABASE_NAME>",
},
],
"services": [
{
"binding": "NEXT_CACHE_REVALIDATION_WORKER",
"service": "<WORKER_NAME>",
},
],
}
```

Expand Down