Skip to content

Commit ca53869

Browse files
authored
Reduce cache TTL for regional cache and log cache debug (#4232)
1 parent 33598e6 commit ca53869

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

packages/gitbook/openNext/customWorkers/defaultWrangler.jsonc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@
9292
},
9393
"staging": {
9494
"vars": {
95-
"OPEN_NEXT_REQUEST_ID_HEADER": "true"
95+
"OPEN_NEXT_REQUEST_ID_HEADER": "true",
96+
"NEXT_PRIVATE_DEBUG_CACHE": "true"
9697
},
9798
"r2_buckets": [
9899
{
@@ -136,7 +137,8 @@
136137
// This is a bit misleading, but it means that we can have 500 concurrent revalidations
137138
// This means that we'll have up to 100 durable objects instance running at the same time
138139
"MAX_REVALIDATE_CONCURRENCY": "100",
139-
"OPEN_NEXT_REQUEST_ID_HEADER": "true"
140+
"OPEN_NEXT_REQUEST_ID_HEADER": "true",
141+
"NEXT_PRIVATE_DEBUG_CACHE": "true"
140142
},
141143
"r2_buckets": [
142144
{

packages/gitbook/openNext/incrementalCache/server.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ export default withRegionalCache(new GitbookIncrementalCache(), {
66
// Because of a race condition, the middleware may have populated the cache entry before `cache.match` had time to run on the server.
77
// TODO: We should bypass the incremental cache entirely when the interceptor has caught the request. Should be done in OpenNext.
88
bypassTagCacheOnCacheHit: false,
9-
defaultLongLivedTtlSec: 60 * 60 * 24 /* 24 hours */,
9+
//TODO: remove, reducing cache ttl of regional cache to help debugging
10+
defaultLongLivedTtlSec: 5 * 60 /* 5 minutes */,
1011
// We don't want to update the cache entry on every cache hit
1112
shouldLazilyUpdateOnCacheHit: false,
1213
});

0 commit comments

Comments
 (0)