views:

13

answers:

1

Hi, I am working on design for a resource server. I want to gather some industry best practices on it.

Scenario:

A data driven portal application hosted on a web farm.

Whenever a request comes, controls are rendered and response is sent. For each image on the page, browser requests for the image separately using a webservice. Since they all are catered through one IIS7 pipeline, there is session contention. Therefore the first request completes, the rest of the requests(for images, etc) follow one after another and the total page load time gets low.

One solution is to take out the general resource handler service out of the solution and deploy it as a standalone service. This will still have some lagging affect but there wont be any session contention, session setup, request setup operations involved which are otherwise required. The problem with this approach is how do I know that the request has been validated?

Please provide some feedback and suggestions.

Thanks

A: 

Two thoughts.

First, if I understand your post correctly, your resource web service is relying on session; generally this is not industry best practice. Services should be stateless. If you're worried about authentication or authorization, pass credentials each time in the request.

Second, for images, you're going to get better scalability if you serve those as static content. (Ideally, you'd cache them, perhaps on your load balancer or other hardware so that IIS doesn't have to deal with them.) Are the images dynamically generated somehow? Or is the resource service simply making a decision about which images to serve up to any given user at any given time? If the latter, make that decision while rendering the page, and spit out links to static content rather than a web service.

millerjs