3 ms·
If you're deciding to paginate the output from an endpoint, please, I implore you, think about how much data you're returning to the client per page. I have wor
by deathanatos 4y ago
If you're deciding to paginate the output from an endpoint, please, I implore you, think about how much data you're returning to the client per page. I have worked with so. many. APIs. where the max page size is "100 items", and each item is … 300 B, for a total page size of ~30 KiB.
And then if you want to pull down the entire result set, you end up drinking it through a coffee stir, and it takes an absurd number of usually serialized calls. Latency kills. 100 calls later and you've downloaded a whopping "big data" level of 3 MiB. That would have fit just fine in 1, maybe 3 API calls.
By far the worst offender I've run across is Azure's Container Registry, where a combination of ridiculously high latency and small page size results in something like 3 MiB of container metadata taking like 5 minutes to fetch. I remember bug reporting it (won't Fix! gaaaahh) and IIRC, we computed the overall throughput to be ~56 kbps.