diff --git a/src/app/articles/[slug]/page.tsx b/src/app/articles/[slug]/page.tsx index 0a9557b..db05d89 100644 --- a/src/app/articles/[slug]/page.tsx +++ b/src/app/articles/[slug]/page.tsx @@ -1,6 +1,6 @@ import type { Metadata } from "next"; import { cleanExcerpt } from "@/lib/articles/excerpt"; -import { redirect } from "next/navigation"; +import { notFound } from "next/navigation"; import ArticleDetailPage from "./ArticleDetailClient"; import type { Article } from "@/lib/articles/types"; import { @@ -10,7 +10,10 @@ import { getRelatedForumThreads, type RelatedForumThread, } from "@/lib/articles/legacy-source"; -export const revalidate = 3600; +// Deleted or unpublished posts must 404 immediately — never serve a stale +// cached article shell for up to an hour after DB removal. +export const dynamic = "force-dynamic"; +export const revalidate = 0; export const dynamicParams = true; interface PageProps { @@ -90,9 +93,7 @@ export default async function ArticlePage({ params }: PageProps) { const { slug } = await params; const { article, related, relatedForumThreads } = await loadArticle(slug); if (!article) { - // Slug isn't in any of our article tables — send the reader to the news - // index so a click from the homepage/ticker doesn't dead-end on 404. - redirect("/news"); + notFound(); } const articleSchema = {