News for hackers. Stuff that matters.
Re:Why Node.js streams are awesome by nevinera on Sunday March 25, 2012 @08:43AM (#3752428)
You can do a solid best-guess estimate, especially if those images are already in compressed formats.
Re:Why Node.js streams are awesome by RogerE on Sunday March 25, 2012 @08:59AM (#3752465)
You can guess, but browsers are quite picky about this header --- guess any amount too low and the download is truncated. Guess too high, and the browser will wait for an amount of time just to be sure the server isn't going to send more data.
Re:Why Node.js streams are awesome by stephank on Sunday March 25, 2012 @11:24AM (#3752808)
I wonder if this would actually be useful to support in HTTP? (An `Estimated-Content-Length` header or similar, only valid with `Connection: close`.)
Re:Why Node.js streams are awesome by FooBarWidget on Sunday March 25, 2012 @05:51PM (#3753958)
It would be better to include progress estimation information as a chunked encoding extension. This allows much better progress reporting.
Re:Why Node.js streams are awesome by j_s on Sunday March 25, 2012 @10:36PM (#3754678)
Note that it is possible to "always guess long" and pad out with null bytes... this usually works (many file format parsers aren't too picky). However, this is more of a practical work-around than a recommended solution!