Improving HttpHandler parallelism

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);
 
B

bruce barker

if you use sessions, then requests are serialized for the same user.
turn off session support. you should add code to handle head requests so
the browser can use cached images. also add timestamp info to headers


note: the browser will only do 2 requests at a time.


-- bruce (sqlwork.com)
 
A

Alan Samet

That nailed it. Thanks a million.

if you use sessions, then requests are serialized for the same user.
turn off session support. you should add code to handle head requests so
the browser can use cached images. also add timestamp info to headers

note: the browser will only do 2 requests at a time.

-- bruce (sqlwork.com)








- Show quoted text -
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top