I have been using getFromBrowseableDirectories which is simple to use and includes support for byte ranges. The test files include some quite large MP4 files for which a browser will use ranges to skip to a position in the playback. An example request:
2018-04-14T09:30:56.496Z GET /P1070390.MP4 206 Partial Content 2.2ms range(bytes=62554112-176800745) [28.2MiB 569ms 23.2MiB/s]
Here the time from request to returning the HttpResponse object is 2.2ms, BUT it is another 569ms before the first packet of the entity data is returned. This is the time taken to read and discard the first 62MB of the file. Actually surprisingly good, but this is running on my dev machine with an SSD and more memory available than is likely if used in production.
So my next task is to produce a file source which produces range results without simply discarding the unwanted data. Does anyone already have such a source?
I am planning to use the NIO.2 AsynchronousFileChannel as it avoids some issues with the older FileChannel api. On the other hand it does want its own thread pool.