diff --git a/apps/website/src/app/[lang]/about/page.tsx b/apps/website/src/app/[lang]/about/page.tsx index 9b0b38a..39b4720 100644 --- a/apps/website/src/app/[lang]/about/page.tsx +++ b/apps/website/src/app/[lang]/about/page.tsx @@ -28,7 +28,7 @@ const STATS = [ export default async function AboutPage({ params }: { params: Promise<{ lang: string }> }) { const { lang } = await params; - const res = await fetch(`${API_BASE}/settings?lang=${lang}`, { next: { revalidate: 600 } }); + const res = await fetch(`${API_BASE}/settings?lang=${lang}`, { next: { revalidate: 0 } }); const settings = res.ok ? await res.json() : {}; const brandName = settings?.brandName || ''; diff --git a/apps/website/src/app/[lang]/article/[slug]/page.tsx b/apps/website/src/app/[lang]/article/[slug]/page.tsx index 68ac050..566f3a5 100644 --- a/apps/website/src/app/[lang]/article/[slug]/page.tsx +++ b/apps/website/src/app/[lang]/article/[slug]/page.tsx @@ -10,7 +10,7 @@ import { API_BASE } from '@/lib/api' async function getArticle(slug: string): Promise
{ try { - const res = await fetch(`${API_BASE}/articles/${slug}`, { next: { revalidate: 300 } }) + const res = await fetch(`${API_BASE}/articles/${slug}`, { next: { revalidate: 0 } }) return res.ok ? res.json() : null } catch { return null } } diff --git a/apps/website/src/app/[lang]/category/[id]/page.tsx b/apps/website/src/app/[lang]/category/[id]/page.tsx index 80c2984..578348c 100644 --- a/apps/website/src/app/[lang]/category/[id]/page.tsx +++ b/apps/website/src/app/[lang]/category/[id]/page.tsx @@ -19,7 +19,7 @@ type CategoryProductsResponse = { async function getCategoryProducts(id: string, lang: string): Promise> { return await fetchJsonResult(`/categories/${id}/products?limit=1000&lang=${lang}`, { - next: { revalidate: 60 }, + next: { revalidate: 0 }, }) } diff --git a/apps/website/src/app/[lang]/layout.tsx b/apps/website/src/app/[lang]/layout.tsx index 83948b2..9a6edbc 100644 --- a/apps/website/src/app/[lang]/layout.tsx +++ b/apps/website/src/app/[lang]/layout.tsx @@ -41,7 +41,7 @@ export async function generateMetadata({ params }: { params: Promise<{ lang: str } // Cache configuration: 0 for dev (no cache), strict numbers for production -const getCacheTime = (prodSeconds: number) => process.env.NODE_ENV === 'development' ? 0 : prodSeconds; +const getCacheTime = (prodSeconds: number) => 0; // Temporary bypass for 5-day testing // Fetch categories for Navbar and Footer on the server async function getCategories(lang: string) { diff --git a/apps/website/src/lib/cms.ts b/apps/website/src/lib/cms.ts index d238918..2cd52c7 100644 --- a/apps/website/src/lib/cms.ts +++ b/apps/website/src/lib/cms.ts @@ -2,7 +2,7 @@ import type { Article, Category, Order, Page, Product } from '@homaroma/types' import { API_BASE } from './api' const isDev = process.env.NODE_ENV === 'development' -const defaultRevalidate = isDev ? 0 : 60 +const defaultRevalidate = 0 type ProductListResponse = { data?: Product[] @@ -63,11 +63,11 @@ export async function fetchJsonResult(path: string, init?: RequestInit & { ne } export async function getCategories(lang = 'all'): Promise { - return await fetchJson(`/categories?lang=${lang}`, { next: { revalidate: isDev ? 0 : 3600 } }) ?? [] + return await fetchJson(`/categories?lang=${lang}`, { next: { revalidate: 0 } }) ?? [] } export async function getCategoriesResult(lang = 'all'): Promise> { - return await fetchJsonResult(`/categories?lang=${lang}`, { next: { revalidate: isDev ? 0 : 3600 } }) + return await fetchJsonResult(`/categories?lang=${lang}`, { next: { revalidate: 0 } }) } export async function getCmsPage(slug: string, lang = 'all'): Promise {