Problem
Each time the dashboard page loads, the server fires fresh API requests to GitHub for stats (commit counts, PR metrics, streak data) even when the underlying data has not changed. GitHub's REST API has a rate limit of 5,000 requests per hour per authenticated token. A user who refreshes the dashboard frequently, or a deployment with many active users sharing one token, will hit the rate limit and receive degraded responses (HTTP 403) until the window resets.
Steps to Reproduce
- Open the dashboard
- Observe the network panel: GitHub API calls fire on every page load
- Refresh the page 60-70 times in quick succession
- Observe HTTP 403 responses with
X-RateLimit-Remaining: 0
Proposed Fix
Cache GitHub API responses server-side with a short TTL (5-15 minutes) using Redis or the existing Supabase instance:
const CACHE_TTL = 10 * 60; // 10 minutes in seconds
export async function getCachedGitHubStats(username: string) {
const cached = await redis.get(`gh:stats:${username}`);
if (cached) return JSON.parse(cached);
const fresh = await fetchGitHubStats(username);
await redis.setex(`gh:stats:${username}`, CACHE_TTL, JSON.stringify(fresh));
return fresh;
}
Also display the last-refreshed timestamp in the UI so users understand they are viewing cached data.
Complexity: Level 2/3 | Program: GSSOC '26
Problem
Each time the dashboard page loads, the server fires fresh API requests to GitHub for stats (commit counts, PR metrics, streak data) even when the underlying data has not changed. GitHub's REST API has a rate limit of 5,000 requests per hour per authenticated token. A user who refreshes the dashboard frequently, or a deployment with many active users sharing one token, will hit the rate limit and receive degraded responses (HTTP 403) until the window resets.
Steps to Reproduce
X-RateLimit-Remaining: 0Proposed Fix
Cache GitHub API responses server-side with a short TTL (5-15 minutes) using Redis or the existing Supabase instance:
Also display the last-refreshed timestamp in the UI so users understand they are viewing cached data.
Complexity: Level 2/3 | Program: GSSOC '26