Since watching Supercharging page load by Jake Archibald, I’ve been wanting to try streaming Dust templates with Hapi. While conceptually simple, it took a bit of fiddling. I forked a plugin and modified it to convert Dust’s streams into proper ones.
Everything is finally in place, and Hapi is serving the streamed templates, but I am still receiving the full response only when the stream closes.
After a variety of test cases, the behavior seems to be somewhere in Hapi and not the Node APIs. I’ll try tracking down the culprit this weekend.