From 97789a0b592c4872a23011bc4938dc156e2d0159 Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Mon, 1 Sep 2025 10:36:05 +0100 Subject: [PATCH 1/3] add `bypassTagCacheOnCacheHit` option to cloudflare's regional cache documentation --- pages/cloudflare/caching.mdx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pages/cloudflare/caching.mdx b/pages/cloudflare/caching.mdx index dff6a9d..8ff288e 100644 --- a/pages/cloudflare/caching.mdx +++ b/pages/cloudflare/caching.mdx @@ -313,7 +313,10 @@ The regional cache has two modes: - `short-lived`: Responses are re-used for up to a minute. - `long-lived`: Fetch responses are re-used until revalidated, and ISR/SSG responses are re-used for up to 30 minutes. -Additionally, lazy updating of the regional cache can be enabled with the `shouldLazilyUpdateOnCacheHit` option. When requesting data from the cache, it sends a background request to the R2 bucket to get the latest entry. This is enabled by default for the `long-lived` mode. +Additionally there are two options you can use to customize the behavior of the regional cache: + +- `shouldLazilyUpdateOnCacheHit`: Instructs the cache to be lazily updated, meaning that when requesting data from the cache, a background request is sent to the R2 bucket to get the latest entry. This is enabled by default for the `long-lived` mode. +- `bypassTagCacheOnCacheHit`: Instructs the cache not to check the tag cache when there is a regional cache hit reducing response times. When this option is used you need to make sure that the cache gets correctly purged either by enabling the auto cache purging feature or doing that manually. Defaults to `false`. ```ts // open-next.config.ts From df56d6bf552185f79747dc060c461e2320482885 Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Mon, 1 Sep 2025 11:01:39 +0100 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Victor Berchet --- pages/cloudflare/caching.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/cloudflare/caching.mdx b/pages/cloudflare/caching.mdx index 8ff288e..56aa603 100644 --- a/pages/cloudflare/caching.mdx +++ b/pages/cloudflare/caching.mdx @@ -313,10 +313,10 @@ The regional cache has two modes: - `short-lived`: Responses are re-used for up to a minute. - `long-lived`: Fetch responses are re-used until revalidated, and ISR/SSG responses are re-used for up to 30 minutes. -Additionally there are two options you can use to customize the behavior of the regional cache: +Additionally there are options you can use to customize the behavior of the regional cache: - `shouldLazilyUpdateOnCacheHit`: Instructs the cache to be lazily updated, meaning that when requesting data from the cache, a background request is sent to the R2 bucket to get the latest entry. This is enabled by default for the `long-lived` mode. -- `bypassTagCacheOnCacheHit`: Instructs the cache not to check the tag cache when there is a regional cache hit reducing response times. When this option is used you need to make sure that the cache gets correctly purged either by enabling the auto cache purging feature or doing that manually. Defaults to `false`. +- `bypassTagCacheOnCacheHit`: Instructs the cache not to check the tag cache when there is a regional cache hit. This enables reducing response times. When this option is used you need to make sure that the cache gets correctly purged either by enabling the [automatic cache purge](https://opennext.js.org/cloudflare/caching#automatic-cache-purge) or purging the cache manually. Defaults to `false`. ```ts // open-next.config.ts From 37ab00f0a21a3b0e6b3240c99e0114ff1ec5766d Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Mon, 1 Sep 2025 11:04:26 +0100 Subject: [PATCH 3/3] avoid full url --- pages/cloudflare/caching.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/cloudflare/caching.mdx b/pages/cloudflare/caching.mdx index 56aa603..81f8883 100644 --- a/pages/cloudflare/caching.mdx +++ b/pages/cloudflare/caching.mdx @@ -316,7 +316,7 @@ The regional cache has two modes: Additionally there are options you can use to customize the behavior of the regional cache: - `shouldLazilyUpdateOnCacheHit`: Instructs the cache to be lazily updated, meaning that when requesting data from the cache, a background request is sent to the R2 bucket to get the latest entry. This is enabled by default for the `long-lived` mode. -- `bypassTagCacheOnCacheHit`: Instructs the cache not to check the tag cache when there is a regional cache hit. This enables reducing response times. When this option is used you need to make sure that the cache gets correctly purged either by enabling the [automatic cache purge](https://opennext.js.org/cloudflare/caching#automatic-cache-purge) or purging the cache manually. Defaults to `false`. +- `bypassTagCacheOnCacheHit`: Instructs the cache not to check the tag cache when there is a regional cache hit. This enables reducing response times. When this option is used you need to make sure that the cache gets correctly purged either by enabling the [automatic cache purge](#automatic-cache-purge) or purging the cache manually. Defaults to `false`. ```ts // open-next.config.ts