1 hour ago · 6 min read1160 words · Tech · hide · 0 comments

Book Corners has grown quite a lot since I introduced it earlier this year. Today it has 37,238 approved public bookcases, and the map is the page people use the most. A few days ago I looked at how much data the map endpoint was sending and I didn’t like what I found. The problem The map page loads its markers from a GeoJSON endpoint: /map/libraries.geojson. The page always sends the current zoom level and the visible area (the “bounds”), and at low zoom levels the server already groups libraries into clusters using PostGIS. That works fine for the map page itself, but there were a few cases where the endpoint returned one feature for every single library: requests without any parameter (direct calls, old links, bots…) requests with a zoom but without bounds requests with invalid bounds, which silently fell back to the full dataset any search filter (keywords, city, country, postal code), which turned clustering off at every zoom level These are the numbers I measured in production:…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.