Images taking minutes to load RRS feed

  • Question

  • User-1226263862 posted

    I've got an application where users upload jpg images to a file system and they are displayed using a handler.  I store the path to the images in the database and when it comes time to gather the images and display them I get the path for that record, then loop through all the files in that path's folder.  I then have  handler that reads the image(s) from the location on the disk and writes the image to the page (HttpContext.Response.BinaryWrite()). 

    Some images take less than a second to load some take minutes to load.  The images are less than 1MB in size and the process has worked perfect since its implementation a few months back.  Yes, the location the images are stored on is on a network share although bandwidth isn't an issue (had network support review it for this particular issue).  Also checked permissions and the user I am using to get the images from disk has full access to that directory.


    Wednesday, August 1, 2012 11:52 AM

All replies

  • User1779161005 posted

    It's hard to tell, but I'd suggest profiling all those moving parts you described to identify which piece is taking so long. The Stopwatch class is great for gathering timing information.

    Wednesday, August 1, 2012 12:10 PM
  • User-1226263862 posted

    Thanks for the suggestion althought I've already tried that and everything runs fast as lightning.  The slowness is happening somewhere after the page_unload event and I'm not sure where to track that at.

    Wednesday, August 1, 2012 4:42 PM