Round-2 follow-up: profile at 500c/u showed _execute still dominating the uncached read endpoints (/bounty 76%, /logs/histogram 73%, /deckies 56%). Same router-level TTL pattern as /stats — 5s window, asyncio.Lock to collapse concurrent calls into one DB hit. - /bounty: cache default unfiltered page (limit=50, offset=0, bounty_type=None, search=None). Filtered requests bypass. - /logs/histogram: cache default (interval_minutes=15, no filters). Filtered / non-default interval requests bypass. - /deckies: cache full response (endpoint takes no params). - /config: bump _STATE_TTL from 1.0 to 5.0 — admin writes are rare, 1s was too short for bursts to coalesce at high concurrency.
2.8 KiB
2.8 KiB