Split out from a review observation by @alanhargreaves on #1096 ("ok it looks like /api/callsign does not check our caches. It probably should.").
The DX-paths enrichment pipeline maintains callsignLookupCache (24h TTL, populated by background HamQTH lookups in server/routes/dxcluster.js), but the /api/callsign/:call route appears to run its own lookup chain without consulting it — so the same callsign can be resolved repeatedly against external services (QRZ/HamQTH) even when we already hold a fresh answer.
Expected: /api/callsign/:call should check the shared cache(s) before any external lookup, and populate them on a miss, so the popup lookups and the paths enrichment share one pool.
Why it matters: fewer external API calls (QRZ/HamQTH rate budgets are per-key), faster popup responses, and the paths enrichment benefits from popup-triggered lookups for free.
There is already a TODO in server/routes/dxcluster.js noting the duplicated lookup chain ("Refactor lookup chain into callsign.js") — this issue is the concrete user-visible half of that refactor.
Split out from a review observation by @alanhargreaves on #1096 ("ok it looks like
/api/callsigndoes not check our caches. It probably should.").The DX-paths enrichment pipeline maintains
callsignLookupCache(24h TTL, populated by background HamQTH lookups inserver/routes/dxcluster.js), but the/api/callsign/:callroute appears to run its own lookup chain without consulting it — so the same callsign can be resolved repeatedly against external services (QRZ/HamQTH) even when we already hold a fresh answer.Expected:
/api/callsign/:callshould check the shared cache(s) before any external lookup, and populate them on a miss, so the popup lookups and the paths enrichment share one pool.Why it matters: fewer external API calls (QRZ/HamQTH rate budgets are per-key), faster popup responses, and the paths enrichment benefits from popup-triggered lookups for free.
There is already a TODO in
server/routes/dxcluster.jsnoting the duplicated lookup chain ("Refactor lookup chain into callsign.js") — this issue is the concrete user-visible half of that refactor.