mirror of
https://github.com/koala73/worldmonitor.git
synced 2026-05-15 03:26:22 +02:00
16,710 AviationStack requests/day instead of expected ~1,368. Root cause: when 2h Redis cache expires, multiple Vercel Edge instances each independently fire 114 API calls (inflight coalescing is process-local). Fix: cron job writes to Redis every 2h with 4h TTL, so user requests always hit cache. - New api/cron/warm-aviation-cache.ts (edge runtime, CRON_SECRET auth) - Three independent sources: FAA, AviationStack (intl), NOTAM - Unhealthy AviationStack responses skip cache write to preserve data - vercel.json: crons array at "0 */2 * * *" - Expected reduction: 16,710 → ~1,368 requests/day (92%)