feat: background cache warmer for virtual repositories #28
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Virtual repository `index.yaml` rebuilds are currently on-demand: when the Redis TTL expires, the next request triggers a full rebuild — parallel HTTP fetches across all member remotes, plus a YAML parse/merge/dump cycle. With 19 members this takes ~22s fetch + ~44s merge = ~66s total, blocking the client.
Proposed solution
Add a background task (FastAPI `BackgroundTasks` or a dedicated async loop) that proactively re-warms the virtual index before it expires, so the virtual handler only ever serves from S3 — never rebuilds inline.
Behaviour
Implementation notes
Related
Observed timings with 19 member repos: `fetch=22749ms merge=44083ms store=109ms` — the merge/dump of ~1 M lines of YAML is the dominant cost and would move entirely off the request path with this change.