File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed
examples/overrides/kv-tag-next
packages/cloudflare/src/api/overrides/tag-cache Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change 1
1
{
2
- "name" : " kv -tag-next" ,
2
+ "name" : " d1 -tag-next" ,
3
3
"version" : " 0.1.0" ,
4
4
"private" : true ,
5
5
"scripts" : {
Original file line number Diff line number Diff line change @@ -13,12 +13,10 @@ export const BINDING_NAME = "NEXT_TAG_CACHE_KV";
13
13
*
14
14
* Warning:
15
15
* This implementation is considered experimental for now.
16
- * KV is eventually consistent and can take up to 60s to reflect the last write.
16
+ * KV is eventually consistency and can take up to 60s to reflect the last write.
17
17
* This means that:
18
18
* - revalidations can take up to 60s to apply
19
- * - when a page depends on multiple tags they can be inconsistent for up to 60s.
20
- * It also means that cached data could be outdated for one tag when other tags
21
- * are revalidated resulting in the page being generated based on outdated data.
19
+ * - when a page depends on multiple tags they can be inconsistent for up to 60s
22
20
*/
23
21
export class KVNextModeTagCache implements NextModeTagCache {
24
22
readonly mode = "nextMode" as const ;
@@ -30,6 +28,7 @@ export class KVNextModeTagCache implements NextModeTagCache {
30
28
return 0 ;
31
29
}
32
30
31
+ console . log ( `[KVNextModeTagCache] getLastRevalidated, tags=${ tags } ` ) ;
33
32
try {
34
33
const keys = tags . map ( ( tag ) => this . getCacheKey ( tag ) ) ;
35
34
// Use the `json` type to get back numbers/null
@@ -63,8 +62,6 @@ export class KVNextModeTagCache implements NextModeTagCache {
63
62
await kv . put ( this . getCacheKey ( tag ) , timeMs ) ;
64
63
} )
65
64
) ;
66
-
67
- // TODO: See https://github.com/opennextjs/opennextjs-aws/issues/986
68
65
await purgeCacheByTags ( tags ) ;
69
66
}
70
67
You can’t perform that action at this time.
0 commit comments