Reduce egress costs, add PWA support, fix Polymarket and Railway relay

Egress optimization:
- Add s-maxage + stale-while-revalidate to all API endpoints for Vercel CDN caching
- Add vercel.json with immutable caching for hashed assets
- Add gzip compression to sidecar responses >1KB
- Add gzip to Railway RSS responses (4 paths previously uncompressed)
- Increase polling intervals: markets/crypto 60s→120s, ETF/macro/stablecoins 60s→180s
- Remove hardcoded Railway URL from theater-posture.js (now env-var only)

PWA / Service Worker:
- Add vite-plugin-pwa with autoUpdate strategy
- Cache map tiles (CacheFirst), fonts (StaleWhileRevalidate), static assets
- NetworkOnly for all /api/* routes (real-time data must be fresh)
- Manual SW registration (web only, skip Tauri)
- Add offline fallback page
- Replace manual manifest with plugin-generated manifest

Polymarket fix:
- Route dev proxy through production Vercel (bypasses JA3 blocking)
- Add 4th fallback tier: production URL as absolute fallback

Desktop/Sidecar:
- Dual-backend cache (_upstash-cache.js): Redis cloud + in-memory+file desktop
- Settings window OK/Cancel redesign
- Runtime config and secret injection improvements
This commit is contained in:
Elie Habib
2026-02-14 19:52:57 +04:00
parent 427d9c1f3f
commit c353cf2070
91 changed files with 7204 additions and 1757 deletions

View File

@@ -1,7 +1,7 @@
{
"name": "world-monitor",
"private": true,
"version": "2.1.4",
"version": "2.2.0",
"type": "module",
"scripts": {
"dev": "vite",
@@ -44,6 +44,7 @@
"@types/topojson-specification": "^1.0.5",
"typescript": "^5.7.2",
"vite": "^6.0.7",
"vite-plugin-pwa": "^1.2.0",
"ws": "^8.19.0"
},
"dependencies": {