You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/open-next/src/types/overrides.ts
+40Lines changed: 40 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -99,6 +99,27 @@ type BaseTagCache = {
99
99
name: string;
100
100
};
101
101
102
+
/**
103
+
* On get :
104
+
We have to check for every tag (after reading the incremental cache) that they have not been revalidated.
105
+
106
+
In DynamoDB, this would require 1 GetItem per tag (including internal one), more realistically 1 BatchGetItem per get (In terms of pricing, it would be billed as multiple single GetItem)
107
+
108
+
On set :
109
+
We don't have to do anything here
110
+
111
+
On revalidateTag for each tag :
112
+
We have to update a single entry for this tag
113
+
114
+
Pros :
115
+
- No need to prepopulate DDB
116
+
- Very little write
117
+
118
+
Cons :
119
+
- Might be slower on read
120
+
- One page request (i.e. GET request) could require to check a lot of tags (And some of them multiple time when used with the fetch cache)
121
+
- Almost impossible to do automatic cdn revalidation by itself
We just check for the cache key in the tag cache. If it has been revalidated we just return null, otherwise we continue
135
+
136
+
On set :
137
+
We have to write both the incremental cache and check the tag cache for non existing tag/key combination. For non existing tag/key combination, we have to add them
138
+
139
+
On revalidateTag for each tag :
140
+
We have to update every possible combination for the requested tag
141
+
142
+
Pros :
143
+
- Very fast on read
144
+
- Only one query per get (On DynamoDB it's a lot cheaper)
145
+
- Can allow for automatic cdn invalidation on revalidateTag
146
+
147
+
Cons :
148
+
- Lots of write on set and revalidateTag
149
+
- Needs to be prepopulated at build time to work properly
0 commit comments