Skip to content

perf(cache): reuse GitHub content with transactional visibility revisions - #187

Merged
f0rr0 merged 1 commit into
nextfrom
f0rr0/github-content-cache
Oct 1, 2026
Merged

f0rr0 merged 1 commit into
nextfrom
f0rr0/github-content-cache

Conversation

@f0rr0

@f0rr0 f0rr0 commented Oct 1, 2026

Copy link
Copy Markdown
Owner

GitHub's 60-second fallback reread the full activity payload even when its revision had not changed. Repository visibility changes also left cached public names and links visible until expiry because those writes did not advance the feed revision.

Cache revision-keyed activity content for one hour, refresh live head metadata only when it matches the cached content, and renew the existing 60-second outage fallback from successful responses without another database read. Healthy requests always return the current version. A transactional statement trigger advances feed, head, and ordering revisions whenever visibility changes for a repository with published snapshots, covering inventory, normal updates, and direct SQL writes.

Validation:

  • 290 tests passed with disposable PostgreSQL 17 and native Next caches (1,643 assertions). Checked-in integration coverage includes real inventory writers, private/internal/unknown visibility, stale observations, no-op updates, concurrency, batching, rollback, missing head, metadata/body races, and outage recovery.
  • Across 61 idle requests over 3,660 simulated seconds, payload reads fell from the investigated baseline's 61 to 2. This measures the initial activity path, not total production egress.
  • Production-mode Next fixture using the exact final cache source passed publication/in-flight races, failed rebuild recovery, a one-second stalled-read deadline, fresh status without body reads, and a real 61-second expired-fallback outage.
  • Desktop (1440px) and mobile (390px) browser checks passed: loaded history and expansions survive refresh failures/new days, ordering-only updates refresh, stale pagination is ignored, and no duplicate days, overflow, or runtime errors appeared.
  • Formatting, lint, Knip, type checks, deployment-source type check, Typst format check, and production build passed. All 31 migrations applied to a fresh local database; reapplication succeeded. The generated Drizzle snapshot has no schema changes.

Apply migration 0030 before deploying the longer cache. The documented production build runs migrations before building. This PR does not deploy or change pagination/UI behavior. Production billing savings remain to be measured.

@vercel

vercel Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
f0rr0-github-io Ready Ready Preview Oct 1, 2026 3:03am UTC

@f0rr0
f0rr0 merged commit 9cbdb9d into next Oct 1, 2026
4 checks passed
@f0rr0
f0rr0 deleted the f0rr0/github-content-cache branch October 1, 2026 03:05

This branch was successfully deployed

1 active deployment
Preview — f859b6ff Deployed Oct 1, 2026 by vercel[bot]
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