Stable image URLs (post-signing removal) make page-level caching safe again. Homepage, genre page, sitemap, and detail page now revalidate on an interval instead of running Prisma on every hit. Reader and search keep dynamic rendering (searchParams) but wrap their Prisma queries in unstable_cache. TTLs: home/genre/detail 5m, reader manga 5m, reader page meta 1h (immutable), search 1m, sitemap 1h. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
27 lines
653 B
TypeScript
27 lines
653 B
TypeScript
import { prisma } from "@/lib/db";
|
|
import { collectGenres } from "@/lib/genres";
|
|
import { GenreTabs } from "@/components/GenreTabs";
|
|
import type { Metadata } from "next";
|
|
|
|
export const revalidate = 300;
|
|
|
|
export const metadata: Metadata = {
|
|
title: "Genres",
|
|
};
|
|
|
|
export default async function GenrePage() {
|
|
const manga = await prisma.manga.findMany({
|
|
where: { status: "PUBLISHED" },
|
|
orderBy: { title: "asc" },
|
|
include: { _count: { select: { chapters: true } } },
|
|
});
|
|
|
|
const genres = collectGenres(manga);
|
|
|
|
return (
|
|
<div className="max-w-6xl mx-auto px-4 py-5">
|
|
<GenreTabs manga={manga} genres={genres} />
|
|
</div>
|
|
);
|
|
}
|