Problem description
The leaderboard API mixes public leaderboard data with optional user-specific rank data.
Public leaderboard responses are good candidates for CDN caching, but user-specific data should be handled separately to avoid cache confusion and make privacy boundaries clearer.
Expected behavior
The project should have a clearer separation between:
- Public anonymous leaderboard data
- User-specific rank/profile data
Reproduction steps
Review the current leaderboard API behavior and caching strategy.
Initial files to inspect:
app/api/leaderboard/all/route.ts
app/api/leaderboard/global/route.ts
app/api/leaderboard/profile/route.ts
lib/kv.ts
Impact
- Safer caching model
- Clearer privacy boundary
- Better API maintainability
- Easier future public API design
Suggested direction
- Keep public leaderboard endpoints cache-friendly.
- Move user-specific rank/profile reads to separate endpoints.
- Document the intended API boundary.
- Avoid changing ranking behavior in the first PR unless necessary.
Problem description
The leaderboard API mixes public leaderboard data with optional user-specific rank data.
Public leaderboard responses are good candidates for CDN caching, but user-specific data should be handled separately to avoid cache confusion and make privacy boundaries clearer.
Expected behavior
The project should have a clearer separation between:
Reproduction steps
Review the current leaderboard API behavior and caching strategy.
Initial files to inspect:
app/api/leaderboard/all/route.tsapp/api/leaderboard/global/route.tsapp/api/leaderboard/profile/route.tslib/kv.tsImpact
Suggested direction