Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.

Commit 22e1835

Browse files
committed
enable ISG and revalidate every 60 seconds
1 parent 78792d5 commit 22e1835

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pages/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Index.propTypes = {
4545
export async function getStaticProps({preview = false}) {
4646
const allPosts = await getAllPostsForHome(preview)
4747
return {
48-
props: {allPosts, preview}
48+
props: {allPosts, preview},
49+
revalidate: 60
4950
}
5051
}

pages/posts/[slug].js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ export async function getStaticProps({params, preview = false, previewData}) {
7676
preview,
7777
post: data.post,
7878
posts: data.posts
79-
}
79+
},
80+
revalidate: 60
8081
}
8182
}
8283

0 commit comments

Comments
 (0)