A
Alan Samet
I have a performance issue related to HttpHandlers.
I've written a photo gallery application that uses HttpHandlers to
manage a virtual URL to my thumbnails. When I render the document with
the actual thumbnail URLs, the images appear to load instantly. When
using the HttpHandler, it looks as if the images are loaded one at a
time -- as if the HttpHandler execution is serialized. I assume this
is caused by ASP.NET processing the request vs. the standard IIS
static file handlers. Is there a way to improve the simultaneous image
loads?
The code in the httphandler is almost literally this (where filepath
is created via concatenation):
image = Image.FromFile(filePath);
HttpContext.Current.Response.ContentType = "image/jpeg";
image.Save(HttpContext.Current.Response.OutputStream,
ImageFormat.Jpeg);
I've written a photo gallery application that uses HttpHandlers to
manage a virtual URL to my thumbnails. When I render the document with
the actual thumbnail URLs, the images appear to load instantly. When
using the HttpHandler, it looks as if the images are loaded one at a
time -- as if the HttpHandler execution is serialized. I assume this
is caused by ASP.NET processing the request vs. the standard IIS
static file handlers. Is there a way to improve the simultaneous image
loads?
The code in the httphandler is almost literally this (where filepath
is created via concatenation):
image = Image.FromFile(filePath);
HttpContext.Current.Response.ContentType = "image/jpeg";
image.Save(HttpContext.Current.Response.OutputStream,
ImageFormat.Jpeg);