Skip to content

feat(website): persist history with TanStack Query - #119

Merged
chenjiahan merged 2 commits into
mainfrom
chenjiahan/website-query-cache
Nov 11, 2026
Merged

chenjiahan merged 2 commits into
mainfrom
chenjiahan/website-query-cache

Conversation

@chenjiahan

Copy link
Copy Markdown
Member

Summary

Refreshing the dashboard currently discards loaded history, and development Strict Mode cancels and restarts its requests. Use TanStack Query to share requests and persist the last successful snapshot in IndexedDB for 24 hours. Reloads show cached data after hydration while refreshing in the background; failed refreshes retain that snapshot and offer an in-place retry.

Keep SSR limited to the page shell and retain the 15-second request timeout. Storage failures fall back to the in-memory cache, and window focus does not trigger another full download.

Validation

Using Node 24.22.0:

  • pnpm build:website
  • pnpm --filter ecosystem-ci-website exec tsc --noEmit
  • pnpm check
  • pnpm --filter ecosystem-ci-website exec cf deploy --prebuilt --dry-run

Browser checks covered persistence of the real 10 MB dataset, cache restoration before network completion, failed refreshes across reloads, retry, cache expiry/version invalidation, and unavailable/full storage. Development made seven JSON requests with zero cancellations; SSR HTML stayed at about 33.5 kB without history records.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T11:08:32.205771Z 60fd402 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://chenjiahan-website-query-cache-rstack-ecosystem-ci.rstack.workers.dev (commit 48e2f08)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://f0e1fc8e-rstack-ecosystem-ci.rstack.workers.dev 48e2f08 2026-11-11T06:48:32.491Z Visit the dashboard ↗

@chenjiahan
chenjiahan merged commit bac166b into main Nov 11, 2026
28 of 30 checks passed
@chenjiahan
chenjiahan deleted the chenjiahan/website-query-cache branch November 11, 2026 06:59
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