NancyFx/Nancy — Issue #515: content transfer very slow with self host
Author: pihai
Created: 2012-02-22 11:00:11+00:00
State: open

i set up a console application and used self host to serve a simple razor site .. when i accessed the site through an other computer the site was really slow. i found out that loading additional content (jquery usw) causes the high latency.

i tried the following in my nancymodule

Get["/file1"] = par => {
var path = new FileInfo(@"content\jquery-1.7.1.min.js");
return new StreamReader(path.FullName).ReadToEnd();
};
Get["/file2"] = par => {
var path = new FileInfo(@"content\jquery-1.7.1.min.js");
return new GenericFileResponse(path.FullName);
};

the result was that the request to file1 took 20ms and file2 took 6 seconds! (filesize 120kb)

so is this a bug, do i something wrong, or whats causing the high latency?