I have an ASMX Web Service, which I am serving over HTTPS. After some testing, I arrived to the conclusion the Web Service would be intolerably slow in a real-world scenario.
I understand that the overhead of using HTTPS is unavoidable, but I would like to know how I could optimize this Web Service. The first thing I have noticed is that, most of the time, my Web Service returns lists of things, for example (not taken from the actual Web Service):
<Cars count="2">
<Car brand="Mercedes" registrationplate="612M0D0"/>
<Car brand="BMW" registrationplate="4RS-73CHN1C4"/>
</Cars>
(Usual real-life values of count are around 40-50.)
Thus, both the element’s type’s name (in this example, Car) and its attributes names (in this example, brand and registrationplate) are repeated too many times. All of this suggests compressing the SOAP response before sending it would a good idea. But I don’t know to do it. Does anybody know?
Have you determined what is slow?
etc.
The first step in optimisation is to get metrics and then once you have these attack the ones that matter. For example a call to the function may be 1ms but if you call it 2000 times the delay may be 2s. So in this case attacking the number of calls may be in order.
I suggest using a tool like DotTrace to give you indicators.
Edit
See this so question : HTTP vs HTTPS performance