Conversation
…onger dynamic per-request (#942) (#944) The home page and every /[locale]/* route were server-rendered on demand (`ƒ`) on every request: prod returned `cache-control: no-store` + `x-vercel-cache: MISS` on each hit, so every anonymous visitor paid a full SSR + 6 backend round-trips, with the function running in iad1 while the edge was icn1 (~0.75-1s HTML TTFB). Root cause was next-intl (v4) static-rendering opt-out, not the data: the home server fetches carry no auth (always the public/anon view) and all personalization is client-side, so the HTML is identical for anonymous users and fully cacheable. Three things forced dynamic rendering: - `NextIntlClientProvider` rendered without explicit `locale`/`now`/ `timeZone` (next-intl opts the tree into dynamic when these are omitted), - no `generateStaticParams` for `[locale]`, - `setRequestLocale` missing from the (shell) layout and the page. This change adds all three. The app uses zero next-intl formatters (date "time ago" is computed manually in components), so the pinned `now`/`timeZone` have no rendering effect — they only satisfy the static opt-in. Also drops the unused `searchParams` from the home page (awaited but never read). Result (verified via `next build` + local `bun start`): - `/[locale]` → `● (SSG)` with `Revalidate: 1m`; prod-equivalent header becomes `s-maxage=60, stale-while-revalidate` + `x-nextjs-prerender: 1` (edge-cacheable — anonymous HTML served from the edge, no iad1 hit; substantially mitigates the region gap in #943 too). - `library`/`profile`/`settings`/`style-dna`/`decoded` also flipped from needless `ƒ` to `●` (they were client-data shells, dynamic only because of the shared provider); genuinely dynamic routes (`explore`, `posts/[id]`, `items/[id]`, `profile/[userId]`) correctly stay `ƒ`. - Browser-verified logged-out (rails, mood tabs) and logged-in (greeting by name, personalized sections, all 5 flipped routes) with zero hydration errors. 819 unit tests pass. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dev→main릴리스. 콘텐츠 델타는 PR #944 (홈[locale]트리 ISR 화) 단일 변경.main머지 시 Vercel 이decoded.style프로덕션 자동 배포.Ships
[locale]트리를 next-intl 정적 렌더 조건 충족으로 ISR(● SSG+ revalidate 60s) 전환. 홈·library·profile·settings·style-dna·decoded익명 HTML 이 엣지 캐시로 서빙 → iad1 함수 호출 없이 첫 화면.Closes #942.s-maxage=60, stale-while-revalidate), 로그인/로그아웃 브라우저(하이드레이션 에러 0), 유닛 819개.Post-deploy 확인
decoded.style/en응답 헤더no-store→s-maxage/prerender,x-vercel-cacheMISS→HIT관련: 리전 #943(ISR 로 상당 완화), 이미지 이중 홉 #810.