3 ms·
I agree. If you're doing something slow/asynchronous like aggregating several http resources it is worth it to write out as early as you can but keep server-sid
by joombar 13y ago
I agree. If you're doing something slow/asynchronous like aggregating several http resources it is worth it to write out as early as you can but keep server-side the same if you can generate the whole JSON quickly.
- jbrooksuk 13y agoNope, just parsing some results back from MySQL.
- reddit_clone 13y agoOne issue I found with writing early is handling error condition(s). On the server side, you may run into an error after you started writing out your reply. That may cause an incomplete reply. It may require more involved error handling between the server and client. 'Gather first write later' approach gives you a simpler error propagation between server and client.