Skip to content

Commit c0e9c49

Browse files
conico974Nicolas Dorseuil
andauthored
Optimize cache retrieval performance and reduce costs on 2C (#3542)
Co-authored-by: Nicolas Dorseuil <[email protected]>
1 parent afc4bd4 commit c0e9c49

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/gitbook/openNext/incrementalCache.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,13 @@ class GitbookIncrementalCache implements IncrementalCache {
4848
const result = (await localCacheEntry.json()) as WithLastModified<
4949
CacheValue<CacheType>
5050
>;
51-
return this.returnNullOn404(result);
51+
return this.returnNullOn404({
52+
...result,
53+
// Because we use tag cache and also invalidate them every time,
54+
// if we get a cache hit, we don't need to check the tag cache as we already know it's not been revalidated
55+
// this should improve performance even further, and reduce costs
56+
shouldBypassTagCache: true,
57+
});
5258
}
5359

5460
const r2Object = await r2.get(cacheKey);

0 commit comments

Comments
 (0)