I have this MVC view that has a list of images, these images are dynamic so they come from a controller. To simplify things this controller has only this code:
[OutputCache(Duration = 0, NoStore = true, Location = OutputCacheLocation.None)]
public ActionResult RenderImage(int id)
{
return File(@"C:\Users\Pictures\myimage.png", "image/png");
}
I'm not caching things to prove my point.
My view requests 8 images all with a different id, and the timings are horrible:
Sometimes it's fast for some images (which are all the same) and on each refresh it's different, can't find a pattern in it.
The app is hosted in IIS and the timetaken in the server logs shows it's the server that is eating up the time:
Has anyone a clue why this happens? If I request the images individually (not in the page) it's always fast.