title: What is the complete process from entering a url to the browser's address bar to get the rendered page in browser?
body: <p>I'm thinking about this question for a long time. It is a <strong>big</strong> question, since it almost covers all corners related to web developing.</p>
  
  <p>In my understanding, the process should be like:</p>
  
  <ol>
  <li>enter the url to the address bar</li>
  <li>a request will be sent to the DNS server based on your network configuration</li>
  <li>DNS will route you to the real IP of the domain name</li>
  <li>a request(with complete Http header) will be sent to the server(with 3's IP to identify)'s 80 port(suppose we don't specify another port)</li>
  <li>server will search the listening ports and forward the request to the app which is listening to 80 port(let's say nginx here) or to another server(then 3's server will be like a load balancer)</li>
  <li>nginx will try to match the url to its configuration and serve as an static page directly, or invoke the corresponding script intepreter(e.g PHP/Python) or other app to get the dynamic content(with DB query, or other logics)</li>
  <li>a html will be sent back to browser with a complete Http response header</li>
  <li>browser will parse the DOM of html using its parser</li>
  <li>external resources(JS/CSS/images/flash/videos..) will be requested <em>in sequence</em>(or not?) </li>
  <li>for JS, it will be executed by JS engine</li>
  <li>for CSS, it will be rendered by CSS engine and HTML's display will be adjusted based on the CSS(<em>also in sequence or not</em>?)</li>
  <li>if there's an iframe in the DOM, then a separate same process will be executed from step 1-12</li>
  </ol>
  
  <p>The above is my understanding, but I don't know whether it's correct or not? How much precise? Did I miss something?</p>
  
  <p>If it's correct(or almost correct), I hope:</p>
  
  <ol>
  <li>Make the step's description more precise in your words, or write your steps if there is a big change</li>
  <li>Make a deep explanation for each step which you are most familiar with. </li>
  <li>One answer per step. Others can make supplement in each answer's comment.</li>
  </ol>
  
  <p>And I hope this thread can help all web developers to have a better understanding about what we do everyday.</p>
  
  <p>And I will update this question based on the answers.</p>
  
  <p>Thanks.</p>