I have an Mvc action that sends "FilePathResult" for the image "jpeg"as shown below.
public ActionResult GetImage()
{
string outputImagePath = Server.MapPath(@"Images/OutputImage.jpeg");
return File(outputImagePath , "image/jpeg");
}
Now it takes significantly longer compared to linking to the image path using direct Url . The time shown below is shown below.
http: // WebSite / Controller / GetImage takes 500 ms
http: //WebSite/Images/OutputImage.jpeg takes 10 ms
Is this normal, or am I missing something?
Update: This is an average time. I am using the following environment.
.Net 4, Asp.Net 2.0, IIS 7.5, Ninject
source
share