Skip to content

Commit 02174b3

Browse files
committed
optimize home revalidate
1 parent 11b44ff commit 02174b3

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

app/(home)/components/latest-posts.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import ArrowCard from '@/components/arrow-card';
44
import NavLink from '@/components/nav-link';
55
import client from '@/tina/__generated__/client';
66

7+
export const revalidate = 3600; // invalidate every hour
8+
79
const LatestPosts: React.FC = async () => {
810
const { data } = await client.queries.postConnection({ last: 3, sort: 'date' });
911

app/(home)/components/summary.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { TinaMarkdown } from 'tinacms/dist/rich-text';
22

33
import client from '@/tina/__generated__/client';
44

5+
export const revalidate = 3600; // invalidate every hour
6+
57
const Summary: React.FC = async () => {
68
const { data } = await client.queries.page({ relativePath: 'home.mdx' });
79

app/(home)/page.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import LatestPosts from './components/latest-posts';
22
import Summary from './components/summary';
33

4-
export const revalidate = 3600; // invalidate every hour
5-
64
export default function Home() {
75
return (
86
<div className="mx-auto max-w-screen-md px-5">

0 commit comments

Comments
 (0)