Skip to content

Commit 3185cf5

Browse files
committed
caching and prerender
1 parent 03ceee8 commit 3185cf5

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/app/archive/[[...slug]]/page.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ import CategoryList from '@/components/Archive/CategoryList'
99
import TaskList from '@/components/Archive/TaskList'
1010
import prisma from '@/lib/prisma'
1111
import { ISolved } from '@/types/tasks'
12-
import { getCategory } from '@/utils/getCategoryTree'
12+
import { generatePath, getCategory } from '@/utils/getCategoryTree'
1313

1414
export const metadata: Metadata = {
1515
title: 'Archive | programming.in.th'
1616
}
1717

18+
export const revalidate = 3600 // 1 hour
19+
1820
export default async function Archive({
1921
params
2022
}: {
@@ -70,9 +72,9 @@ async function generatePaths(slug: string[]) {
7072
return paths
7173
}
7274

73-
// export async function generateStaticParams() {
74-
// const paths = (await generatePath()).map(path => ({
75-
// slug: path
76-
// }))
77-
// return paths
78-
// }
75+
export async function generateStaticParams() {
76+
const paths = (await generatePath()).map(path => ({
77+
slug: path
78+
}))
79+
return paths
80+
}

0 commit comments

Comments
 (0)