feat(ssg): add ISR (revalidate=60) for dynamic database pages to keep data fresh
This commit is contained in:
@@ -4,6 +4,8 @@ import { getBlogPosts } from "@/app/actions";
|
||||
import BlogDetailClient from "@/components/BlogDetailClient";
|
||||
import { notFound } from "next/navigation";
|
||||
|
||||
export const revalidate = 60;
|
||||
|
||||
// Convert DB format to expected BlogPost format
|
||||
function mapBlogPost(dbPost: any) {
|
||||
return {
|
||||
|
||||
@@ -3,6 +3,8 @@ import type { Locale } from "@/i18n-config";
|
||||
import BlogClient from "@/components/BlogClient";
|
||||
import { getBlogPosts } from "@/app/actions";
|
||||
|
||||
export const revalidate = 60;
|
||||
|
||||
export async function generateMetadata({ params }: { params: Promise<{ lang: Locale }> }) {
|
||||
const { lang } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
|
||||
Reference in New Issue
Block a user