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
Right now the tag cache is made to work mostly with DynamoDB and does not work in the same way as in next standalone. We should add a different mode for the tag cache (and support both) that would work in the same way as in next standalone.
We should probably add a dynamodb-nextmode override and add some docs explaining the difference and which one you should choose
Current Implementation
On get
We just check for the cache key in the tag cache without having to reach the incremental cache. If it has been revalidated we just return null, otherwise we continue and check the incremental cache
On set
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
On revalidateTag for each tag
We have to update every possible combination for the requested tag
Pros
Very fast on read
Only one query per get (On DynamoDB it's a lot cheaper)
Avoid having to reach the incremental cache for revalidated item
Cons
Lots of write on set and revalidateTag
Needs to be prepopulated at build time to work properly
New Mode
On get
We have to check for every tag (after reading the incremental cache) that they have not been revalidated.
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)
On set
We don't have to do anything here
On revalidateTag for each tag
We have to update a single entry for this tag
Pros
No need to prepopulate DDB
Very little write
Cons
Might be slower on read
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)
Needs to reach the incremental cache first on get
The text was updated successfully, but these errors were encountered:
Right now the tag cache is made to work mostly with DynamoDB and does not work in the same way as in next standalone. We should add a different mode for the tag cache (and support both) that would work in the same way as in next standalone.
We should probably add a
dynamodb-nextmode
override and add some docs explaining the difference and which one you should chooseCurrent Implementation
On
get
We just check for the cache key in the tag cache without having to reach the incremental cache. If it has been revalidated we just return
null
, otherwise we continue and check the incremental cacheOn
set
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
On
revalidateTag
for each tagWe have to update every possible combination for the requested tag
Pros
get
(On DynamoDB it's a lot cheaper)Cons
set
andrevalidateTag
New Mode
On
get
We have to check for every tag (after reading the incremental cache) that they have not been revalidated.
In DynamoDB, this would require 1
GetItem
per tag (including internal one), more realistically 1BatchGetItem
perget
(In terms of pricing, it would be billed as multiple singleGetItem
)On
set
We don't have to do anything here
On
revalidateTag
for each tagWe have to update a single entry for this tag
Pros
Cons
GET
request) could require to check a lot of tags (And some of them multiple time when used with the fetch cache)get
The text was updated successfully, but these errors were encountered: