title: ASP.NET MVC slow image loading through MVC framework?
body: <p>On some photobook page i want to show appr 20 thumbnails. These thumbnails are programatically loaded from a database. those thumbnails are already resized. When i show them the images load kinda slow. some take 0.5 seconds to load some wait for 2 secons. The database doesn't matter because when i remove the database layer, the performance issue still exists.When i load the same images directly with html the problem the images do load immediately. </p>
  
  <p>Is loading images/files through the mvc framework slow or am i missing something?</p>
  
  <p>This goes too slow</p>
  
  <pre><code>//in html
  &lt;img src='/File/Image.jpg' border='0'&gt;                    
  
  //in controller
  public FileResult File(string ID)
  {           
      //database connection removed, just show a pic
      byte[] imageFile = System.IO.File.ReadAllBytes(ID);
      return new FileContentResult(imageFile,"image/pjpeg");
  }
  </code></pre>
  
  <p>This goes immediately</p>
  
  <pre><code>&lt;img src='/Content/Images/Image.jpg' border='0'&gt;                    
  </code></pre>