- you enter
- your browser will do a DNS look up for the IP address of this URL. This process is:
- check browser cache – the OS does not tell the browser the TTL for each DNS record so the browser caches DNS records itself for 2 – 30 minutes
- check OS cache – e.g.
gethostbynameon the Mac and Windows
- check router cache
- check ISP DNS cache
- recursive search
- root nameserver
- .com nameserver
- example.com nameserver
- browser sends a GET HTTP request to the web server along with other headers. e.g.
- Accept: types of responses it will accept
- Connection: TCP connection
- server probably responds with a 301 Permanent redirect to www.example.com
- browser sends out another request to
- server handles the request
- i.e. it reads the request, any parameters and cookies
- server sends back an HTML response which consists of
- HTTP/1.1 200 OK header
- Content-Encoding: gzip
- Content-Type: text/html; charset=utf-8
- Byte blob which the Content-Encoding section tells you is gzip’d.
- Decompress the blob to get the HTML
- Browser renders the HTML as it starts receiving it
- Browser sends requests for objects embedded in the HTML. E.g.
- Browser sends further AJAX
See Hypertext Transfer Protocol — HTTP/1.1 (RFC 2616): https://tools.ietf.org/html/rfc2616