-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy pathpage.tsx
33 lines (28 loc) · 908 Bytes
/
page.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { unstable_cacheLife as cacheLife, unstable_cacheTag as cacheTag } from 'next/cache'
import {
BasePageComponentProps,
getDataImplementation,
PageComponentImplementation,
ResultComponentImplementation,
ResultWrapperComponentProps,
} from '../../../../../helpers'
async function getData(route: string) {
'use cache'
cacheTag(`data/${route}`)
cacheLife('5seconds')
return await getDataImplementation(route)
}
async function ResultWrapperComponent(props: ResultWrapperComponentProps) {
return <ResultComponentImplementation {...props} />
}
export default async function PageComponent({ params }: BasePageComponentProps) {
return (
<PageComponentImplementation
routeRoot="default/use-cache-data/dynamic/ttl-5seconds"
params={params}
getData={getData}
ResultWrapperComponent={ResultWrapperComponent}
/>
)
}
export const dynamic = 'force-dynamic'