Skip to content

feat: cache GitHub metrics with Upstash Redis#311

Open
saurabhhhcodes wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
saurabhhhcodes:codex/upstash-metrics-cache-234
Open

feat: cache GitHub metrics with Upstash Redis#311
saurabhhhcodes wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
saurabhhhcodes:codex/upstash-metrics-cache-234

Conversation

@saurabhhhcodes
Copy link
Copy Markdown

Summary

  • add a reusable Upstash Redis metrics cache helper with graceful no-env fallback
  • cache GitHub-backed metrics for contributions, repos, PR summaries, and streak active dates
  • apply endpoint-specific TTLs: contributions 5m, repos 10m, PRs 10m, streak 2m
  • add deterministic keys scoped by user/account, endpoint, and query params
  • support explicit cache bypass/refresh via refresh=1, bypassCache=true, sync=true, or x-devtrack-cache-bypass: 1
  • document optional Upstash env vars in .env.example

Fixes #234

GSSoC label request

If accepted, please add:

  • gssoc:approved
  • level:advanced
  • quality:clean
  • type:performance
  • type:backend

Testing

  • node /tmp/codex-npm-cli/bin/npm-cli.js run type-check
  • node /tmp/codex-npm-cli/bin/npm-cli.js run lint ✅ passes with pre-existing warnings in BadgeSection.tsx and CommitTimeChart.tsx
  • git diff --check
  • node -e "JSON.parse(require('fs').readFileSync('package-lock.json','utf8'))"

Build note

  • node /tmp/codex-npm-cli/bin/npm-cli.js run build compiles successfully, then fails while collecting page data because this local environment does not have Supabase env configured (supabaseUrl is required) in /api/auth/link-github. That is unrelated to the metrics cache change.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 18, 2026

@saurabhhhcodes is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel.

A member of the Team first needs to authorize it.

@saurabhhhcodes
Copy link
Copy Markdown
Author

Quick maintainer note: the PR is mergeable and the code-side checks passed locally (type-check, lint, git diff --check). Vercel deployment is waiting for team authorization, which I cannot complete from the fork.

If this is accepted for GSSoC, could you please add gssoc:approved, level:advanced, quality:clean, type:performance, and type:backend? This closes the assigned caching issue #234.

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.

[FEAT] Add Upstash Redis caching layer for GitHub API responses

1 participant