Summary
All GitHub API calls (contributions, PRs, repos, streak) are fetched fresh on every dashboard load.
With no caching, heavy users hit GitHub's 5,000 req/hr rate limit quickly and dashboard loads are slow.
Add a server-side caching layer with configurable TTL and manual invalidation.
Problem
- Every page load fires 4–5 GitHub API requests per user
- No deduplication if multiple tabs are open
- Rate limit errors surface as broken widgets with no recovery path
- Cold dashboard load can take 3–5s on slow connections
Proposed Solution
Implement an in-memory LRU cache (or Supabase table as fallback) for API route responses:
| Route |
Suggested TTL |
/api/metrics/contributions |
10 minutes |
/api/metrics/prs |
15 minutes |
/api/metrics/repos |
15 minutes |
/api/metrics/streak |
5 minutes |
- Cache key:
userId:route:params
- Use
lru-cache npm package (zero infra) or Supabase api_cache table with expires_at column
- Expose a
?refresh=true query param to force-bust cache for a route
- Add
X-Cache: HIT | MISS header on API responses for debuggability
Acceptance Criteria
I would like to work on this under GSSoC
Summary
All GitHub API calls (contributions, PRs, repos, streak) are fetched fresh on every dashboard load.
With no caching, heavy users hit GitHub's 5,000 req/hr rate limit quickly and dashboard loads are slow.
Add a server-side caching layer with configurable TTL and manual invalidation.
Problem
Proposed Solution
Implement an in-memory LRU cache (or Supabase table as fallback) for API route responses:
/api/metrics/contributions/api/metrics/prs/api/metrics/repos/api/metrics/streakuserId:route:paramslru-cachenpm package (zero infra) or Supabaseapi_cachetable withexpires_atcolumn?refresh=truequery param to force-bust cache for a routeX-Cache: HIT | MISSheader on API responses for debuggabilityAcceptance Criteria
src/lib/cache.ts?refresh=trueparam bypasses cache and resets itnpm run lint && npm run type-check)I would like to work on this under GSSoC