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
@@ -90,6 +90,27 @@ type BaseTagCache = {
90
90
name: string;
91
91
};
92
92
93
+
/**
94
+
* On get :
95
+
We have to check for every tag (after reading the incremental cache) that they have not been revalidated.
96
+
97
+
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)
98
+
99
+
On set :
100
+
We don't have to do anything here
101
+
102
+
On revalidateTag for each tag :
103
+
We have to update a single entry for this tag
104
+
105
+
Pros :
106
+
- No need to prepopulate DDB
107
+
- Very little write
108
+
109
+
Cons :
110
+
- Might be slower on read
111
+
- 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)
112
+
- 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
126
+
127
+
On set :
128
+
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
129
+
130
+
On revalidateTag for each tag :
131
+
We have to update every possible combination for the requested tag
132
+
133
+
Pros :
134
+
- Very fast on read
135
+
- Only one query per get (On DynamoDB it's a lot cheaper)
136
+
- Can allow for automatic cdn invalidation on revalidateTag
137
+
138
+
Cons :
139
+
- Lots of write on set and revalidateTag
140
+
- Needs to be prepopulated at build time to work properly
0 commit comments