Skip to content

Fix intermittent docs loading failures#33

Merged
willwashburn merged 1 commit into
mainfrom
codex/fix-docs-static-cache
Jul 21, 2026
Merged

Fix intermittent docs loading failures#33
willwashburn merged 1 commit into
mainfrom
codex/fix-docs-static-cache

Conversation

@willwashburn

@willwashburn willwashburn commented Jul 21, 2026

Copy link
Copy Markdown
Member

Summary

  • make the documentation route tree permanently static between deployments
  • load the docs badge's active GitHub star count directly in the browser, with a one-hour browser cache
  • retain the existing hourly server-side star refresh for non-doc pages

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 in localStorage for 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 /docs load caused by stale-route regeneration. The docs star count updates independently within an hour without causing server-side docs revalidation.

Validation

  • npm run build
  • Verified generated prerender metadata reports revalidate: false for /docs, /docs/introduction, /docs/quickstart, and /docs/file/introduction.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Docs layout revalidation is disabled, and GitHub star fetching now accepts configurable revalidation while the docs badge opts out of revalidation.

Changes

Docs cache behavior

Layer / File(s) Summary
Disable docs layout revalidation
web/app/docs/layout.tsx
The docs layout exports revalidate = false and documents its static caching behavior.
Configure GitHub star fetch caching
web/components/GitHubStars.tsx
getGitHubStars accepts a revalidation value, and DocsGitHubStarsBadgeServer disables revalidation for docs star-count requests.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: khaliqgant

Poem

I’m a rabbit with stars in my paws,
Caching docs without hourly claws.
The layout stays still,
Fetches follow the will,
And static pages hop without pause.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: fixing intermittent docs loading failures.
Description check ✅ Passed The description matches the changeset and explains the static docs and star-badge revalidation changes.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-docs-static-cache

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@willwashburn
willwashburn marked this pull request as ready for review July 21, 2026 16:47

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Preview deployed!

Environment URL
Web https://7e887704-agentrelay-web.agent-workforce.workers.dev

This is a Cloudflare Workers preview version of this PR's build.

@willwashburn
willwashburn force-pushed the codex/fix-docs-static-cache branch from 6e3d50f to 0098cf6 Compare July 21, 2026 16:50
@willwashburn
willwashburn merged commit ca83451 into main Jul 21, 2026
2 of 3 checks passed
@willwashburn
willwashburn deleted the codex/fix-docs-static-cache branch July 21, 2026 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant