Skip to content

Commit 63a0cb9

Browse files
committed
chore: enable cache for ISR read optimization
1 parent 4316088 commit 63a0cb9

File tree

7 files changed

+13
-1
lines changed

7 files changed

+13
-1
lines changed

src/app/[language]/(home)/blog/[slug]/page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { notFound } from 'next/navigation'
66
import { getMDXComponents } from '@/components'
77
import { getLocalizedSources } from '@/lib'
88

9+
export const revalidate = false
10+
911
export default async function Page(props: {
1012
params: Promise<{ slug: string; language: string }>
1113
}) {

src/app/[language]/(home)/blog/page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import type { Metadata } from 'next'
22
import { getLocalizedSources } from '@/lib'
33
import { BlogList } from './components'
44

5+
export const revalidate = false
6+
57
export default async function Home({
68
params,
79
}: {

src/app/[language]/(home)/components/StatsSection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ async function fetchWithDefault<_T>(
1111
): Promise<number> {
1212
try {
1313
const res = await fetch(url, {
14-
next: { revalidate: 3600 }, // Cache for 1 hour
14+
next: { revalidate: 3600 * 24 }, // Cache for 1 day
1515
})
1616
if (!res.ok) return defaultValue
1717

src/app/[language]/(home)/page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import {
1212
} from './components'
1313
import { TypographyBackground } from './components/common'
1414

15+
export const revalidate = false
16+
1517
export default function HomePage() {
1618
return (
1719
<main>

src/app/[language]/docs/[[...slug]]/page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import { getMDXComponents, LLMCopyButton, ViewOptions } from '@/components'
1212
import { defaultLanguage } from '@/i18n'
1313
import { getLocalizedSources } from '@/lib'
1414

15+
export const revalidate = false
16+
1517
export default async function Page(props: {
1618
params: Promise<{ slug?: string[]; language: string }>
1719
}) {

src/app/[language]/playground/page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import type { Language } from '@/i18n'
22
import { PlaygroundBody, PlaygroundHeader } from './components'
33

4+
export const revalidate = false
5+
46
// TODO: write test cases
57
export default async function PlaygroundPage(props: {
68
params: Promise<{ language: string }>

src/app/api/og/[...slug]/route.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ import {
1717
} from '@/lib'
1818
import { blogSourceEs, docsSourceEs } from '@/lib/source'
1919

20+
export const revalidate = false
21+
2022
export async function GET(
2123
req: Request,
2224
{ params }: { params: Promise<{ slug: string[] }> }

0 commit comments

Comments
 (0)