Repository navigation
Cache Components and PPR
Louis Wright edited this page Oct 14, 2026
·
1 revision
Status: planned / pre-release. This wiki page mirrors
docs/and documents the intended API of next-herald. Nothing is published yet; names may change before v1.0. See ROADMAP.
With cacheComponents: true, anything that reads request data (headers(), cookies(), connection(), searchParams) must sit in a dynamic boundary. next-herald never reads request data (ADR 0006), so metadata, JSON-LD, sitemaps and OG images stay prerenderable.
-
siteUrlcomes from config/env at build, neverHost. - All builders are pure; they can run inside
"use cache". - A CI test greps the published code for request-API imports (#7), and an e2e fixture with
cacheComponents: trueasserts every example route is in the static shell.
// generateMetadata with cached data
import { cacheLife, cacheTag } from 'next/cache';
async function getPost(slug: string) {
'use cache';
cacheLife('hours');
cacheTag(`post:${slug}`);
return db.post(slug);
}
export async function generateMetadata({ params }: PageProps<'/blog/[slug]'>) {
const { slug } = await params; // params are fine; with generateStaticParams the page stays static
return pageMetadata(herald, { path: `/blog/${slug}`, title: (await getPost(slug)).title });
}- Don't put the CSP
nonce(a request value) into cached JSON-LD; nonce-based CSP makes the page dynamic by design. - Bots: Next streams metadata to browsers but blocks for
htmlLimitedBots.herald checksends a crawler UA by default (--ua browserto compare). Custom patterns have caused metadata loss under PPR (vercel/next.js#95406, #96594). - Client navigation title loss when a prefetch is in flight (#98684) is a Next router bug outside our control.
Guides
- Getting Started
- Configuration
- Metadata
- JSON LD
- Sitemaps
- Robots
- hreflang and i18n
- OG Images
- CLI and Check Rules
- Cache Components and PPR
- Static Export
- Testing
- AEO Stance
- SEO Preview Panel
- Redirects
- Pagination and Facets
- Image SEO
- Check Diff Mode
- Migration from next seo
- Migration from next sitemap
Reference