From 56de27335c834e5e6de3cc65dedbfb27ee0dd674 Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Mon, 1 Sep 2025 17:07:39 +0200 Subject: [PATCH 1/3] docs(cloudflare): minor updates to the caching doc --- pages/cloudflare/caching.mdx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pages/cloudflare/caching.mdx b/pages/cloudflare/caching.mdx index 81f8883..ec43702 100644 --- a/pages/cloudflare/caching.mdx +++ b/pages/cloudflare/caching.mdx @@ -425,7 +425,8 @@ export default defineCloudflareConfig({ #### Queue -A queue must be setup for projects using revalidation (either Time based or On-demand). +A queue must be setup for projects using Time-Based revalidation. +It is not needed when revalidation is not used nor only On-Demand revalidation is used. **Configure the queue** @@ -719,6 +720,9 @@ This component can either call the Cache API's purge function directly or route Cache purge are only called when you call `revalidateTag`, `revalidatePath` or `res.revalidate` in the pages router. It is not called for ISR revalidation. +The `CACHE_PURGE_API_TOKEN` environment variable/secret need to be set to enable cache purge. +The Token must have the `Cache Purge` permission. + Below is an example configuration for integrating the cache purge component in your `open-next.config.ts`: ```ts From 8dec01ce1573e56c561e55c45140c73d15b8b4ff Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Thu, 4 Sep 2025 12:35:55 +0200 Subject: [PATCH 2/3] fixup! add CACHE_PURGE_... details --- pages/cloudflare/caching.mdx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pages/cloudflare/caching.mdx b/pages/cloudflare/caching.mdx index ec43702..dd707b3 100644 --- a/pages/cloudflare/caching.mdx +++ b/pages/cloudflare/caching.mdx @@ -720,8 +720,9 @@ This component can either call the Cache API's purge function directly or route Cache purge are only called when you call `revalidateTag`, `revalidatePath` or `res.revalidate` in the pages router. It is not called for ISR revalidation. -The `CACHE_PURGE_API_TOKEN` environment variable/secret need to be set to enable cache purge. -The Token must have the `Cache Purge` permission. +To use cache purge, you need to define the following wrangler secrets: +- `CACHE_PURGE_API_TOKEN` should be set to [an API token](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/) with the `Cache Purge` permission +- `CACHE_PURGE_ZONE_ID` should be set to the [zone ID of your deployment domain](https://developers.cloudflare.com/fundamentals/account/find-account-and-zone-ids/) Below is an example configuration for integrating the cache purge component in your `open-next.config.ts`: From 2447478bf9a1c3041c47dd2bfc18c59ca3aa969c Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Thu, 4 Sep 2025 12:37:10 +0200 Subject: [PATCH 3/3] fixup! lint --- pages/cloudflare/caching.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/pages/cloudflare/caching.mdx b/pages/cloudflare/caching.mdx index dd707b3..6d1ab8b 100644 --- a/pages/cloudflare/caching.mdx +++ b/pages/cloudflare/caching.mdx @@ -721,6 +721,7 @@ This component can either call the Cache API's purge function directly or route Cache purge are only called when you call `revalidateTag`, `revalidatePath` or `res.revalidate` in the pages router. It is not called for ISR revalidation. To use cache purge, you need to define the following wrangler secrets: + - `CACHE_PURGE_API_TOKEN` should be set to [an API token](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/) with the `Cache Purge` permission - `CACHE_PURGE_ZONE_ID` should be set to the [zone ID of your deployment domain](https://developers.cloudflare.com/fundamentals/account/find-account-and-zone-ids/)