Fix intermittent docs loading failures#33
Conversation
📝 WalkthroughWalkthroughDocs layout revalidation is disabled, and GitHub star fetching now accepts configurable revalidation while the docs badge opts out of revalidation. ChangesDocs cache behavior
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request disables hourly page and data revalidation for the documentation pages, which are deployed as pre-rendered assets on a read-only Cloudflare cache. It sets revalidate = false in web/app/docs/layout.tsx and updates getGitHubStars in web/components/GitHubStars.tsx to accept a configurable revalidate parameter, disabling it for the docs badge. There are no review comments, and I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Preview deployed!
This is a Cloudflare Workers preview version of this PR's build. |
6e3d50f to
0098cf6
Compare
Summary
Root cause
The website deploys docs through OpenNext's Cloudflare static-assets incremental cache. That adapter is intentionally read-only: it can serve the pre-rendered response, but it cannot persist an ISR regeneration.
The server-rendered docs star badge used
revalidate: 3600, which caused every docs route, including/docs, to become stale hourly. A request that reached the stale route could fall through to Worker-side regeneration, where the read-only cache could not save the result. That created the intermittent browser load failure.Docs routes now use
revalidate: false. The badge fetches only the active repository's count directly from GitHub after the page loads and caches it inlocalStoragefor one hour (with the browser HTTP cache as an additional cache layer). This bypasses Agent Relay infrastructure entirely and avoids sending a server-side request on docs page builds or visits.User impact
Visitors should no longer encounter an occasional failed
/docsload caused by stale-route regeneration. The docs star count updates independently within an hour without causing server-side docs revalidation.Validation
npm run buildrevalidate: falsefor/docs,/docs/introduction,/docs/quickstart, and/docs/file/introduction.