8000 changeset · opennextjs/opennextjs-aws@eaaf1ae · GitHub
[go: up one dir, main page]

Skip to content

Commit eaaf1ae

Browse files
committed
changeset
1 parent 76ce21a commit eaaf1ae

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.changeset/sour-pandas-buy.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
"@opennextjs/aws": minor
3+
---
4+
5+
Introduce support for the composable cache
6+
7+
BREAKING CHANGE: The interface for the Incremental cache has changed. The new interface use a Cache type instead of a boolean to distinguish between the different types of caches. It also includes a new Cache type for the composable cache. The new interface is as follows:
8+
9+
```ts
10+
export type CacheEntryType = "cache" | "fetch" | "composable";
11+
12+
export type IncrementalCache = {
13+
get<CacheType extends CacheEntryType = "cache">(
14+
key: string,
15+
cacheType?: CacheType,
16+
): Promise<WithLastModified<CacheValue<CacheType>> | null>;
17+
set<CacheType extends CacheEntryType = "cache">(
18+
key: string,
19+
value: CacheValue<CacheType>,
20+
isFetch?: CacheType,
21+
): Promise<void>;
22+
delete(key: string): Promise<void>;
23+
name: string;
24+
};
25+
```
26+
27+
NextModeTagCache also get a new function `getLastRevalidated` used for the composable cache:
28+
29+
```ts
30+
getLastRevalidated(tags: string[]): Promise<number>;
31+
```

0 commit comments

Comments
 (0)
0