Skip to content

Commit dbf0c77

Browse files
conico974vicb
andauthored
[cloudflare] docs for #500 (#155)
Co-authored-by: Nicolas Dorseuil <[email protected]> Co-authored-by: Victor Berchet <[email protected]>
1 parent 68547cb commit dbf0c77

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

pages/cloudflare/caching.mdx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,18 @@ export default defineCloudflareConfig({
194194
incrementalCache: withRegionalCache(r2IncrementalCache, { mode: "long-lived" }),
195195
queue: doQueue,
196196
// This is only required if you use On-demand revalidation
197-
tagCache: doShardedTagCache({ baseShardSize: 12 }),
197+
tagCache: doShardedTagCache({
198+
baseShardSize: 12,
199+
regionalCache: true, // Enable regional cache to reduce the load on the DOs
200+
regionalCacheTtlSec: 5, // The TTL for the regional cache
201+
shardReplication: {
202+
numberOfSoftReplicas: 4,
203+
numberOfHardReplicas: 2,
204+
regionalReplication: {
205+
defaultRegion: "enam",
206+
},
207+
},
208+
}),
198209
// Disable this if you want to use PPR
199210
enableCacheInterception: true,
200211
// you can also use the `durableObject` option to use a durable object as a cache purge
@@ -629,6 +640,8 @@ doShardedTagCache takes the following options:
629640
- `shardReplication`: Enable replicating the Shard. Shard replication will duplicate each shards into replicas to spread the load even more
630641
- `numberOfSoftReplicas`: Number of replicas for the soft tag shards
631642
- `numberOfHardReplicas`: Number of replicas for the hard tag shards
643+
- `regionalReplicationOptions` : This setting enables you to replicate shards across different regions, thereby reducing read latency and distributing the load more evenly. By enabling this option, each shard will be replicated in all available regions. Please note that this will increase the number of Durable Objects (DOs) created and the volume of write requests sent to the DOs.
644+
- `defaultRegion`: The default region to use for the replication.
632645
- `maxWriteRetries`: The number of retries to perform when writing tags
633646

634647
</Tabs.Tab>

0 commit comments

Comments
 (0)