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.
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.
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.
Star
9197 Points
2576 Posts
Images taking minutes to load
Aug 01, 2012 11:52 AM|b471code3|LINK
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.
Suggestions?
All-Star
20376 Points
6505 Posts
ASPInsiders
MVP
Re: Images taking minutes to load
Aug 01, 2012 12:10 PM|BrockAllen|LINK
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.
DevelopMentor | http://www.develop.com
thinktecture | http://www.thinktecture.com/
Star
9197 Points
2576 Posts
Re: Images taking minutes to load
Aug 01, 2012 04:42 PM|b471code3|LINK
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.