1. What is the purpose of this project?

Many devices capable of streaming content, and applications which manage software downloads, can issue specific requests to a web server requesting part of a resource. The structure of the request is described by the HTTP Specification. Rather than requesting a resource in its entirety and receiving the full response, or if a response is interrupted, a client can request just a subset of a resource relevant to what a user is trying to accomplish.

Media devices can issue partial requests to allow a user to skip to a particular segment of audio or video without first waiting for the full file to download. Download managers can resume downloads from the point at which a connection was lost or can issue multiple segmented download requests at a time to receive parts of a file quickly and stitch them back together. This library makes it easy for developers to expose dynamic content as stream-capable and resume-capable resources while trying to hold on to ASP.NET MVC design principles.

 

2. How does it work?

The HTTP Specification details the header structure for requests and responses. This project has two main components: a request parser and a response generator. In MVC terms the request parser is an Action Filter. The response generator is an Action Result. When an action is marked with the action filter provided in this project, incoming requests are checked to see if it contains the necessary headers for a ranged request. If not, the request continues as it normally would. If the request is a valid range request, the action filter pulls out the byte range(s) from the headers and other precondition information and passes it to the MVC action handling the request.

After any custom logic is applied, the object is passed to the action result, or response generator. The action result takes care of specifying the correct headers and status code to let the client know the range request was successful and which bytes are being returned.

 

3. Does this work behind load balancers?

Yes. Under the covers this is all HTTP traffic. Any load balance appliance capable of routing normal web traffic will work.

 

4. Will this work on Windows Azure?

Yes. This project has been tested in a Windows Azure MVC 2 Web Role and it reacts and responds exactly the same as a regular ASP.NET MVC web application on IIS. The difference with Azure is built-in load balancing over your web roles and access to different storage mechanisms for storing and retrieving your resources.

 

5. Do my resources need to be directly accessible?

No. Unlike HTTPHandlers which give web servers the ability to support ranged requests on static files that are directly referenced in your web applications, this library gives a developer the full power and flexibility of ASP.NET MVC routing. Instead of a single module which handles the request parsing, resource access and response generation, this library breaks the steps up and wraps the first and last step around actions letting a developer implement whatever logic fits their needs best for the resource access.

Last edited Nov 29, 2010 at 11:02 PM by VikingErik, version 2

Comments

No comments yet.