Skip to content

[cloudflare] docs for #500 #155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 30, 2025
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
15 changes: 14 additions & 1 deletion pages/cloudflare/caching.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,18 @@ export default defineCloudflareConfig({
incrementalCache: withRegionalCache(r2IncrementalCache, { mode: "short-lived" }),
queue: doQueue,
// This is only required if you use On-demand revalidation
tagCache: doShardedTagCache({ baseShardSize: 12 }),
tagCache: doShardedTagCache({
baseShardSize: 12,
regionalCache: true, // Enable regional cache to reduce the load on the DOs
regionalCacheTtlSec: 5, // The TTL for the regional cache
shardReplication: {
numberOfSoftReplicas: 4,
numberOfHardReplicas: 2,
regionalReplication: {
defaultRegion: "enam",
},
},
}),
// Disable this if you want to use PPR
enableCacheInterception: true,
});
Expand Down Expand Up @@ -618,6 +629,8 @@ doShardedTagCache takes the following options:
- `shardReplication`: Enable replicating the Shard. Shard replication will duplicate each shards into replicas to spread the load even more
- `numberOfSoftReplicas`: Number of replicas for the soft tag shards
- `numberOfHardReplicas`: Number of replicas for the hard tag shards
- `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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to doc the total numbers of DO somewhere

- `defaultRegion`: The default region to use for the replication.
- `maxWriteRetries`: The number of retries to perform when writing tags

</Tabs.Tab>
Expand Down