Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save marcogbarcellos/57418f5559a7bbf421b5fc20653b1d19 to your computer and use it in GitHub Desktop.
Save marcogbarcellos/57418f5559a7bbf421b5fc20653b1d19 to your computer and use it in GitHub Desktop.
What happens if you type http://abcdef.com
  • browser looks for the DNS cache
  • browser ask the OS to find the ip
  • OS makes a DNS lookup to find the ip and gives to the browser * Looks for the closest DNS Server to find the IP, if it's not there the DNS Server looks for another DNS Server until finds it
  • OS caches the IP
  • browser opens a tcp connection( If it's HTTPS this step is waay more complicated)
  • browser sends an http request
  • browser receives an http response and may close the connection or reuse for more requests.
  • browser checks what kind of response se he receives: 3xx redirect or conditional, 401 authorization required, 4xx and 5xx errors or 2xx "good" responses
  • If cacheable, browser caches response
  • Browser determine what it'll do with the response(html, image) and either render a page or offer the content for download

Detailed answer

Complete answer with all the details: https://github.com/alex/what-happens-when

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment