title: How does browsers handle DNS lookup and TLS with WebSockets?
body: <p>I'm currently considering the option of implementing websockets in my application. But before doing so, I want to make sure I understand correctly how it works and if it's gonna be worth it.</p>
  
  <p>I understand the basics: Via WebSockets the handshake will be made only once via HTTP and then will talk to the server in order to switch to a lower level TCP layer, at that point, we have a full-duplex channel between the server and the client.</p>
  
  <p>Currently I'm measuring the ajax requests made to my server (which are many), I've got this information:</p>
  
  <p><a href="https://i.stack.imgur.com/L1PqA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/L1PqA.png" alt="Ajax request time"></a></p>
  
  <p>The "DNS Lookup", "Initial connection" and "SSL" times are what I'm trying to eliminate (if possible)</p>
  
  <p>For my understanding these times are part of the handshaking process and I'm assuming that using websockets it will happen only on the beginning (the handshake), but I'm not sure.</p>
  
  <p>So my question is: Am I correct? Implementing WebSockets will ensure that the "DNS lookup" and the "Initial connection" steps happen only on the handshake?</p>
  
  <p>Thanks in advance for your help, and sorry if my understanding is wrong.</p>