Skip to content

Commit 1c9c574

Browse files
committed
tag cache
1 parent bf19486 commit 1c9c574

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pages/aws/config/overrides/tag_cache.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
This override is used by the [`cache` adapter](https://github.com/opennextjs/opennextjs-aws/blob/main/packages/open-next/src/adapters/cache.ts) that is provided by OpenNext to the NextServer. It is also used by OpenNext if `enableCacheInterception` is set to `true` in the configuration and by the `initializationFunction` for prepopulating the cache.
22

33
It is used for the cache tags (i.e. `revalidateTag` and `revalidatePath`). It does not handle anything related to the ISR/SSG cache or the fetch cache used by Next.js.
4-
It's main role is to detremine if a path is stale based on the tags and also to update the tag cache when `revalidateTag` is called.
4+
It's main role is to determine if a path is stale based on the tags and also to update the tag cache when `revalidateTag` is called.
55

66
The current implementation differs from the way Next.js standalone handle cache tags. In the standalone version, the cache tags are stored in a file, and every time a cache entry is accessed, it has to check for every tags if the entry is stale. This approach is very read heavy and doesn't work well with DB like DynamoDB.
77
We choose to go another way. We store tags for every path that exists in the cache. This way, we can easily know if a path is stale by just checking the path instead of every tags used. This approach is more write heavy but it's a tradeoff we are willing to make.
@@ -33,10 +33,14 @@ This implementation is a lighter version of the `dynamodb` TagCache as it uses `
3333
- You need to provide the `CACHE_DYNAMO_TABLE`, `CACHE_BUCKET_REGION`, `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` and `AWS_SESSION_TOKEN` environment variables to your server.
3434
- DynamoDB table should have a primary key `path` of type `String` and a sort key `tag` of type `String`. (It can reuse the same table as the one used by the default `tagCache`)
3535

36+
### dynamodb-nextMode
37+
38+
TBA
39+
3640
### dummy
3741

3842
The Dummy TagCache is a dummy implementation that will throw an exception. It should not be used unless you want to disable cache tags.
3943

4044
### fs-dev
4145

42-
The FsDev TagCache is a simple implementation that stores the cache tags in a file in the `.open-next/cache` folder and interact with it using the filesystem. It is useful for development purposes only.
46+
The FsDev TagCache is a simple implementation that stores the cache tags in a file in the `.open-next/cache` folder and interact with it using the filesystem. It is useful for development purposes only.

0 commit comments

Comments
 (0)