From 4f64c974e93e245a2fac99db7db1796a3d4999c5 Mon Sep 17 00:00:00 2001 From: hamster1963 <1410514192@qq.com> Date: Tue, 1 Oct 2024 00:33:03 +0800 Subject: [PATCH 1/2] feat: cache page when deploy on vercel --- app/[locale]/layout.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/[locale]/layout.tsx b/app/[locale]/layout.tsx index 8bc866f..edeafbb 100644 --- a/app/[locale]/layout.tsx +++ b/app/[locale]/layout.tsx @@ -37,6 +37,8 @@ export const viewport: Viewport = { userScalable: false, }; +export const dynamic = process.env.VERCEL ? "force-static" : "auto"; + export async function generateStaticParams() { return locales.map((locale) => ({ locale })); } From 8e09995edf90a76740e7daa3570daef807e30603 Mon Sep 17 00:00:00 2001 From: hamster1963 <1410514192@qq.com> Date: Tue, 1 Oct 2024 00:36:35 +0800 Subject: [PATCH 2/2] doc: optimization --- app/[locale]/layout.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/app/[locale]/layout.tsx b/app/[locale]/layout.tsx index edeafbb..3e21889 100644 --- a/app/[locale]/layout.tsx +++ b/app/[locale]/layout.tsx @@ -37,6 +37,7 @@ export const viewport: Viewport = { userScalable: false, }; +// optimization: force static for vercel export const dynamic = process.env.VERCEL ? "force-static" : "auto"; export async function generateStaticParams() {