File tree Expand file tree Collapse file tree 2 files changed +22
-20
lines changed
packages/nextjs-cache-handler Expand file tree Collapse file tree 2 files changed +22
-20
lines changed Original file line number Diff line number Diff line change 10
10
"type" : " git" ,
11
11
"url" : " git+https://github.com/fortedigital/nextjs-cache-handler.git"
12
12
},
13
- "version" : " 1.3.0-canary3 " ,
13
+ "version" : " 1.3.0-canary4 " ,
14
14
"type" : " module" ,
15
15
"license" : " MIT" ,
16
16
"description" : " Next.js cache handlers" ,
Original file line number Diff line number Diff line change @@ -9,23 +9,25 @@ import {
9
9
* https://github.com/caching-tools/next-shared-cache/issues/1027
10
10
* https://github.com/vercel/next.js/commit/6a1b6336a3062dfdb1b9dddcee6b836da94fd198
11
11
*/
12
- export class Next15CacheHandler extends CacheHandler {
13
- async set (
14
- cacheKey : string ,
15
- incrementalCacheValue : IncrementalCacheValue | null ,
16
- ctx : {
17
- revalidate ?: number | false ;
18
- fetchCache ?: boolean ;
19
- fetchUrl ?: string ;
20
- fetchIdx ?: number ;
21
- tags ?: string [ ] ;
22
- } & { neshca_lastModified ?: number } ,
23
- ) {
24
- await super . set ( cacheKey , incrementalCacheValue , {
25
- ...ctx ,
26
- revalidate :
27
- ctx . revalidate ||
28
- ( incrementalCacheValue as CachedFetchValue ) ?. revalidate ,
29
- } ) ;
30
- }
12
+ export function Next15CacheHandler ( ) {
13
+ return class extends CacheHandler {
14
+ async set (
15
+ cacheKey : string ,
16
+ incrementalCacheValue : IncrementalCacheValue | null ,
17
+ ctx : {
18
+ revalidate ?: number | false ;
19
+ fetchCache ?: boolean ;
20
+ fetchUrl ?: string ;
21
+ fetchIdx ?: number ;
22
+ tags ?: string [ ] ;
23
+ } & { neshca_lastModified ?: number } ,
24
+ ) {
25
+ await super . set ( cacheKey , incrementalCacheValue , {
26
+ ...ctx ,
27
+ revalidate :
28
+ ctx . revalidate ||
29
+ ( incrementalCacheValue as CachedFetchValue ) ?. revalidate ,
30
+ } ) ;
31
+ }
32
+ } ;
31
33
}
You can’t perform that action at this time.
0 commit comments