Problem
load_or_fetch currently holds the global cache write lock while checking files, reading disk, fetching from Overpass, and writing cache files.
Why this matters
This serializes unrelated callers and can create poor concurrency under load.
Scope
- Refactor to use double-checked insertion.
- Consider per-key in-flight fetch deduplication.
- Only hold the write lock for insertion/replacement.
Acceptance criteria
- Slow I/O is performed outside the global cache write lock.
- Concurrent callers for different regions do not block each other unnecessarily.
- Duplicate fetches for the same region are either prevented or explicitly handled.