Handling Range Requests with Node.js and the HTTP/1.1 Spec



Kit Cambridge shows you how to handle range requests for the HTTP/1.1 spec and Node.js in this video from HTML5 Dev Conf:

What do download accelerators, streaming video, and the HTML5 <audio> element have in common?

They all rely on range requests to transmit data efficiently. Range requests are HTTP's brilliantly simple answer to the question, "How do I download just a portion of a given file?" Although they're supported by most web frameworks, Node doesn't handle range requests out of the box. To that end, we'll be going down to the bare metal as we examine the relevant portions of the HTTP/1.1 spec, learn how to handle such requests correctly, and discuss why they're so useful.