Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

perf: the contest leaderboard response is uncacheable end to end

Open
#389 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
64/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python

Research direction

Start with api/routers/leaderboard.py and dashboard/frontend/vercel.json to trace how the contest response and its edge-cache rules are configured. Keep caching limited to period=contest; first check how the daily and live periods are handled so they remain uncached. Done means contest responses can be cached while daily and live responses retain their current behavior.

Written by the indexing model from the issue text.

Description

func

Surfaced reviewing #387, which points the landing hero at GET /api/v1/leaderboard?period=contest. That makes the highest-traffic anonymous surface in the product issue an uncached rebuild against the 512MB free-tier instance that also serves /app and the protocol surfaces.

Nothing on the path caches the response:

  • api/routers/leaderboard.py:30 sets no Cache-Control and no ETag.
  • dashboard/frontend/vercel.json forces Cache-Control: no-store on /(api|paper|backtest|runs|config|admin|ticker|health|compare)(/.*)?, so the Vercel edge cannot absorb any of it either.
  • The caches that do exist in domain/leaderboard/service.py (_cached_run_index, the skip cache) select which run to draw; they do not memoise the built response.

Per request that means all 12 configured entries get a _find_cached_run lookup plus a db.get_equity_curve, then align_equity_curves over the lot. Measured against a local backend on the committed seed DB: 12 entries x 162 points.

The contest window is fixed and historical, so this is the single most cacheable thing the backend produces. A short public, max-age=... on period=contest plus dropping no-store for that one path would remove the load.

Two things to keep in mind for whoever picks this up:

  • Do not blanket-cache the route. period=daily reaches maybe_schedule_daily_leaderboard_refresh(), and period=live is the Season 0 preview. Only contest is safely cacheable.
  • Related but distinct: #202 covers unblocking the event loop in this route. Caching reduces how often the work runs; it does not make the work non-blocking.
Dominant language
Python
Stars
767
Forks
156
Avg merge
22h 2m
Merged PRs (30d)
88

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Open-Finance-Lab/AgenticTrading

All issues in Open-Finance-Lab/AgenticTrading

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.