Eliminate frontend POI waterfall for faster initial load

Listing stream fires immediately on auth without waiting for POI
fetch. POI distances are not needed for initial rendering and are
only computed when user selects POI metric or sets travel filters.
This saves ~200-500ms on initial load and keeps the stream on the
cached Redis path.
This commit is contained in:
Viktor Barzin 2026-02-22 13:29:54 +00:00
parent 3885fd52fe
commit 8ef6868881
No known key found for this signature in database
GPG key ID: 0EB088298288D958
2 changed files with 36 additions and 7 deletions

View file

@ -69,12 +69,9 @@ export async function* streamListingGeoJSON(
user: AuthUser,
parameters: ParameterValues,
onProgress?: (progress: StreamingProgress) => void,
options?: { includePoiDistances?: boolean; signal?: AbortSignal },
options?: { signal?: AbortSignal },
): AsyncGenerator<PropertyFeature[], void, unknown> {
const params = buildListingParams(parameters);
if (options?.includePoiDistances) {
params.include_poi_distances = 'true';
}
const queryString = buildQueryString(params);
const url = queryString
? `${API_ENDPOINTS.LISTING_GEOJSON_STREAM}?${queryString}`