title: My ASMX Web Service over HTTPS is terribly slow. How to optimize it?
body: <p>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.</p>
  
  <p>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):</p>
  
  <pre><code>&lt;Cars count="2"&gt;
    &lt;Car brand="Mercedes" registrationplate="612M0D0"/&gt;
    &lt;Car brand="BMW" registrationplate="4RS-73CHN1C4"/&gt;
  &lt;/Cars&gt;
  </code></pre>
  
  <p>(Usual real-life values of <code>count</code> are around 40-50.)</p>
  
  <p>Thus, both the element's type's name (in this example, <code>Car</code>) and its attributes names (in this example, <code>brand</code> and <code>registrationplate</code>) 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?</p>