Add Server-Timing header to streaming endpoint

Reports cache_check latency in the response header, visible in
browser DevTools Network tab for ongoing performance monitoring.
This commit is contained in:
Viktor Barzin 2026-02-22 13:27:11 +00:00
parent e53b1e120a
commit 2f3d2dc480
No known key found for this signature in database
GPG key ID: 0EB088298288D958
2 changed files with 15 additions and 0 deletions

View file

@ -355,4 +355,12 @@ class TestStreamingEndpoint:
assert 2 not in feature_ids
assert 1 in feature_ids
def test_streaming_includes_server_timing_header(self, client, mock_repository):
"""Test that streaming response includes Server-Timing header."""
response = client.get("/api/listing_geojson/stream?listing_type=RENT&limit=10")
assert response.status_code == 200
assert "server-timing" in response.headers
assert "cache_check" in response.headers["server-timing"]