perf: shared httpx client, gzip, overlay cache-control

Reuse one TLS pool for overlay upstreams (8s/3s timeouts). Gzip JSON
over 1 KB. Aircraft/vessels Cache-Control max-age=5, alerts/perimeters 30.
Lifespan replaces deprecated on_event startup.
This commit is contained in:
Sirius DevOps 2026-08-27 21:21:19 -04:00
commit 435f63e473
3 changed files with 67 additions and 29 deletions

View file

@ -36,3 +36,4 @@ def test_vessels_empty_without_ais_key():
resp = asyncio.run(_get("/api/vessels"))
assert resp.status_code == 200
assert resp.json() == []
assert "max-age" in (resp.headers.get("cache-control") or "").lower()