Skip to content

[cloudflare]: add option to persist missing tags in regional cache #172

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 1 commit into from
Jul 29, 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
2 changes: 2 additions & 0 deletions pages/cloudflare/caching.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ export default defineCloudflareConfig({
baseShardSize: 12,
regionalCache: true, // Enable regional cache to reduce the load on the DOs
regionalCacheTtlSec: 5, // The TTL for the regional cache
regionalCacheDangerouslyPersistMissingTags: true, // Enable this to persist missing tags in the regional cache
shardReplication: {
numberOfSoftReplicas: 4,
numberOfHardReplicas: 2,
Expand Down Expand Up @@ -661,6 +662,7 @@ doShardedTagCache takes the following options:
- `baseShardSize`: The number of shards to use for the cache. The more shards you have, the more evenly the cache will be distributed across the shards. The default is 4. Soft (internal next tags used for `revalidatePath`) and hard tags (the ones you define in your app) will be split in different shards
- `regionalCache`: Whether to use regional cache for the cache. The default is false. This option is useful when you want to reduce the stress on the durable object
- `regionalCacheTtlSec`: The TTL for the regional cache. The default is 5 seconds. Increasing this value will increase the time it takes for the cache to be invalidated across regions
- `regionalCacheDangerouslyPersistMissingTags`: This option allows you to persist missing tags in the regional cache. Without this option, only tags that have been revalidated at least once will be persisted in the regional cache. This option should only be used if you also purge the cache using the [Cache Purge component](#automatic-cache-purge) (or any similar methods). It is disabled by default.
- `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
Expand Down