-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Describe the bug
On slower devices (e.g. mobile connections), a significant delay occurs between page loading and user list loading. On investigation, the apparent cause is a large response from the "people" API that appears to encode every user's data (including images) in one response, requiring a large download to the end user's device. On faster networks, this is less of an issue but there's still a noticeable (~2s) delay while the API handles the request.
To Reproduce
Steps to reproduce the behavior:
- Open inspect element, navigate to the network tab
- Sort network responses by size
- Observe a single 15+ Mb response from the "people" endpoint with fairly long timing.
I suggest also either artificially limiting your network speed if you have an available tool for it or attempting to load the page on a mobile network to see this behavior in practice.
Expected behavior
A small delay in loading or a progressive update of the user list would be more desirable than the current behavior, which loads everything at once.
Screenshots/Pictures/Video
Additional context
It appears to me that all of the user profile images are encoded in this huge request, which could be a cause of the slowdown. I don't have the context of your infrastructure and whether your API would be able to handle splitting up this request, but I think that might be optimal here? Provided you can support it, I suggest:
- Changing the "people" api response .json to not include the images.
- Loading the profile pictures a few at a time (e.g. first 5, next 5, etc etc until the entire list is populated).
Let me know if this is feasible! If so and if you're looking for additional contributors, I'd love to tackle it. Thanks!