1

Closed

Support for ETags and byte ranges in FilePathResult

description

It would be nice if FilePathResult supported ETags and byte ranges. iOS requires byte range support for videos and caching is an important performance feature.

I've created a FilePathExResult class that handles it if you want to take a look at it. It handles ETags, LastModifiedDate, and MaxAge caching as well as byte ranges.

The code is at http://bizark.codeplex.com/ and the class is located at /Current/BizArkWeb/MVC/ActionResults/FilePathExResult.cs (plus other supporting classes).
Closed Aug 28, 2012 at 5:19 PM by marcind
Thanks for the great suggestion. While this would be a useful addition to MVC’s functionality we think an even more performant solution would be to take advantage of the existing IIS static file serving capabilities, which already supports ETags and byte ranges for any static file. Leveraging IIS would mean that the static files can be served from kernel mode, which should be faster than using the managed request pipeline. One way to achieve this is to make sure that the file is in a publically addressable location and then from an MVC action method issue a redirect response that points at the static file.
Since we don't want to have multiple implementations of the same functionality we will not be making this change at this time. However, you might want to consider contributing this code to http://mvccontrib.codeplex.com/.

comments

HongmeiG wrote Jul 6, 2012 at 6:11 PM

Thanks for your suggestion. Instead of providing a link to your source, do you want to submit a pull request so that the product team can further evaluate? Please also keep in mind that you will need to follow the steps at http://aspnetwebstack.codeplex.com/wikipage?title=Contributing&referringTitle=Home

HongmeiG wrote Aug 13, 2012 at 5:16 PM

Can you please take a look?