Skip to content

[Bug]: Separate public leaderboard cache from user-specific rank data #5

@cyclofan

Description

@cyclofan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions