mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
/api/firms ran JSON.stringify over the whole fire set for every request and sent it uncompressed: about 20 MB per 100,000 detections. The handler now keeps the last body as bytes and reuses it for the same cache entry and stale flag while the clock stays inside the span over which the trailing-24 h filter keeps the same detections, so the JSON a request gets is byte-identical to a fresh serialisation. A client that accepts gzip gets the body gzipped, compressed once per kept body. The span ends when the oldest kept acquisition minute turns 24 h old, so requests minutes apart are still serialised afresh. Co-Authored-By: Claude Fable 5.2 <[email protected]>