perf: the contest leaderboard response is uncacheable end to end
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
- Domain
- backend, performance
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
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:30sets noCache-Controland noETag.dashboard/frontend/vercel.jsonforcesCache-Control: no-storeon/(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=dailyreachesmaybe_schedule_daily_leaderboard_refresh(), andperiod=liveis the Season 0 preview. Onlycontestis 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Open-Finance-Lab/AgenticTrading
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Open-Finance-Lab/AgenticTrading#663 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Open-Finance-Lab/AgenticTrading#661 ·
Maintainers usually reply within 1 day
-
fix(llm): a non-ASCII execution handoff raises UnicodeEncodeError instead of ExecutionHandoffErrorPossibly taken @subidhkhanal claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Open-Finance-Lab/AgenticTrading#659 ·
Maintainers usually reply within 1 day
-
fix(backtests): an LLM action with trailing whitespace ("buy ") is silently droppedPossibly taken @subidhkhanal claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Open-Finance-Lab/AgenticTrading#658 ·
Maintainers usually reply within 1 day
-
fix(llm): Gemini adapter drops thinking tokens from the output countPossibly taken @subidhkhanal claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Open-Finance-Lab/AgenticTrading#657 ·
Maintainers usually reply within 1 day
All issues in Open-Finance-Lab/AgenticTrading
Similar issues
-
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
WLAN-Pi/wlanpi-profiler#341 ·
Maintainers usually reply within 1 day
-
Memory leak: the shared `validation_aborted_error` keeps every traceback it is raised throughPossibly taken @Fire162 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
graphql-python/graphql-core#287 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
roman-corgi/ctc-dip#160 ·
Maintainers usually reply within 1 day
-
type-bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
render_findings.py reads and writes in the host's default encoding, so findings.html breaks on a cp1252 Windows hostPossibly taken @Aaqibhafeezkhan claimed this today. Openbug good first issue mentored python size: XS up-for-grabs
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
dheerajjha/mcp-migrate#366 · 1 comment ·
Maintainers usually reply within 1 day