File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 11const config = {
22 experimental : {
33 useCache : true ,
4+ cacheComponents : true ,
45 reactCompiler : true ,
56 } ,
67
Original file line number Diff line number Diff line change 1+ 'use server' ;
12import { unstable_cache } from 'next/cache' ;
3+ import { unstable_cacheTag as cacheTag } from 'next/cache'
4+
25
36export const funcA = async ( ) => {
47 "use cache" ;
8+ cacheTag ( 'func-a-tag' )
59 await new Promise ( ( resolve ) => setTimeout ( resolve , 2000 ) ) ;
610 return Math . random ( ) ;
711}
@@ -14,6 +18,6 @@ const rand = async () => {
1418
1519export const funcAUnstableCache = unstable_cache (
1620 rand ,
17- [ ] , // cache keys here; leave [] for simple global cache
18- { revalidate : 60 } , // revalidate period in seconds, or use false for infinite
21+ [ 'specific-key' ] , // cache keys here; leave [] for simple global cache
22+ { revalidate : 600 } , // revalidate period in seconds, or use false for infinite
1923) ;
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import { getStatus } from "../../status";
1111import { PublisherIcon } from "../PublisherIcon" ;
1212import { PublisherTag } from "../PublisherTag" ;
1313import { PublishersCard } from "./publishers-card" ;
14- import { funcA , funcAUnstableCache } from "./util" ;
14+ import { funcA , funcAUnstableCache } from '../../app/actions' ;
1515
1616type Props = {
1717 params : Promise < {
You can’t perform that action at this time.
0 commit comments