Skip to content

fix: reduce upstream API pressure with cache TTL optimization#430

Merged
koala73 merged 2 commits intomainfrom
fix/cache-ttl-optimization
Feb 26, 2026
Merged

fix: reduce upstream API pressure with cache TTL optimization#430
koala73 merged 2 commits intomainfrom
fix/cache-ttl-optimization

Conversation

@koala73
Copy link
Owner

@koala73 koala73 commented Feb 26, 2026

Summary

  • Military/Wingbits: All cache TTLs 5min → 15min, batch size 20→10 with 100ms sequential delay (was Promise.all burst), preserve military cache across intelligence refresh cycles
  • Theater posture: Fetch 2 targeted bbox regions (WESTERN + PACIFIC) instead of global states/all — ~95% less data transferred from OpenSky
  • OpenSky edge proxy: Add Vercel CDN caching (s-maxage=120), align timeout 15s → 20s to match server
  • Market handlers: stablecoins/crypto/commodities/sectors Redis cache 3min → 5min
  • Cable health: 3min → 10min (not time-critical)
  • YouTube embed: CDN cache 60s → 15min
  • list-military-flights: Redis cache 2min → 10min

Motivation

Wingbits server team reported burst patterns of ~150 requests/minute after previous optimization PR. Root cause: Promise.all firing 20 parallel detail GETs + intelligence refresh clearing military cache every 5 min + global OpenSky fetch returning 10K+ states.

Test plan

  • Verify military flights still appear on map within 15 min of page load
  • Verify theater posture panel updates correctly
  • Verify market data refreshes (may show 5 min staleness vs previous 3 min)
  • Monitor Wingbits API call volume — expect ~90% reduction
  • Monitor OpenSky API usage — expect significant reduction from bbox targeting

…rrors

- Widen beforeSend regex to catch `null is not an object (evaluating 'u.id')`
  pattern from deck.gl internals during variant switch (WORLDMONITOR-4A, 270 events)
- Remove `in_app` requirement from TypeError suppression — Sentry SDK marks
  deck.gl/maplibre frames inconsistently, causing the filter to miss
- Fix Firefox lexical declaration wording: `can't access` vs Chrome's `Cannot access`
- Add noise filters: isReCreate (Android WebView injection), HTMLImageElement
  style access, WebGL context loss write access
- Military/posture: 5min → 15min (flight cache, theater posture, panel refresh, intelligence refresh)
- Theater posture: fetch 2 targeted bbox regions instead of global states/all (~95% less data)
- Wingbits batch: reduce from 20 to 10, sequential with 100ms delay instead of Promise.all burst
- Preserve intelligenceCache.military across intelligence refresh cycles
- OpenSky edge proxy: add CDN caching (s-maxage=120), align timeout to 20s
- list-military-flights: Redis cache 2min → 10min
- Market handlers: stablecoins/crypto/commodities/sectors 3min → 5min
- Cable health: 3min → 10min
- YouTube embed: s-maxage 60s → 15min
@vercel
Copy link

vercel bot commented Feb 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
worldmonitor Building Building Preview, Comment Feb 26, 2026 5:24pm
worldmonitor-finance Building Building Preview, Comment Feb 26, 2026 5:24pm
worldmonitor-happy Building Building Preview, Comment Feb 26, 2026 5:24pm
worldmonitor-startup Building Building Preview, Comment Feb 26, 2026 5:24pm

Request Review

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant