Skip to content

Commit dd50bbe

Browse files
committed
docs(i18n): note that cookie-based locale forces dynamic rendering
Reading cookies()/headers() in the request config makes translated server content request-dependent, which rules out static generation/ISR on those routes (the reason discover/[from] dropped generateStaticParams). Documents the locale-prefixed routing + setRequestLocale refactor as the path back to SSG if perf regresses.
1 parent 537f2ad commit dd50bbe

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

app/i18n/request.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ function parseAcceptLanguage(header: string): Locale | undefined {
2323
return undefined;
2424
}
2525

26+
// Reading cookies()/headers() makes the locale request-dependent, so any route
27+
// rendering translated server content must be dynamic (no static generation/ISR):
28+
// this is why discover/[from] had to drop generateStaticParams. If this causes a
29+
// perf regression, the (likely) refactor is locale-prefixed routing (/en, /fr, /es)
30+
// + setRequestLocale, which restores static generation per locale.
2631
export default getRequestConfig(async () => {
2732
let locale: Locale = defaultLocale;
2833

0 commit comments

Comments
 (0)