3 ms·
When I load a dynamic page with content that isn't ready, I push the missing content requests it into an array. When the page is done loading, it polls the serv
by josegonzalez 15y ago
When I load a dynamic page with content that isn't ready, I push the missing content requests it into an array. When the page is done loading, it polls the server with the data it needs. Server replies with data and client keeps polling every second or so for more stuff until it's done.
Update: I will never be without work.
- bri3d 15y agoI second this type of approach - when I developed an iOS app that needed to display the results of multiple long-running API requests made on the server-side, I had the app make a request and then wait for data to be pushed to the device on a persistent "back-channel" connection the app kept open. This way data could be displayed as it was available, but the app didn't need to poll or open multiple TCP connections (expensive on EDGE, which was common at the time).