Hacker News new | ask | show | jobs
by chrismeller 2769 days ago
> An alternative would be to keep accumulating data and only process it when there is no split link tag at the end, but this way we can return more data to the browser sooner.

> One thing I was initially worried about was having to modify the “content-length” response header from the original response since we are modifying the content. Luckily, the worker takes care of that automatically and it isn’t something you have to implement.

If the worker is able to do this for you it’s clearly waiting for all of the incoming data to be processed before it begins sending to the browser, so dealing with the incoming data as chunks is actually needlessly complex.