For a comprehensive look at Traffic Control, it is important to understand basic HTTP 1.1 protocol operations and how caches function. The example below illustrates the fulfillment of an HTTP 1.1 request in a situation without CDN or proxy, followed by viewing the changes after inserting different types of (caching) proxies. Several of the examples below are simplified for clarification of the essentials.
For complete details on HTTP 1.1 see RFC 2616 - Hypertext Transfer Protocol – HTTP/1.1.
Below are the steps of a client retrieving the URL
http://www.origin.com/foo/bar/fun.html using HTTP/1.1 without proxies:
- The client sends a request to the Local DNS (LDNS) server to resolve the name
www.origin.comto an IPv4 address.
- If the LDNS does not have this name (IPv4 mapping cached), it sends DNS requests to the ., .com, and .origin.com authoritative servers until it receives a response with the address for
www.origin.com. Per the DNS SPEC, this response has a Time To Live (TTL), which indicates how long this mapping can be cached at the LDNS server. In the example, the IP address found by the LDNS server for www.origin.com is 18.104.22.168.
While longer DNS TTLs of a day (86400 seconds) or more are quite common in other use cases, in CDN use cases DNS TTLs are often below a minute.
The client opens a TCP connection from a random port locally to port 80 (the HTTP default) on 22.214.171.124, and sends this (showing the minimum HTTP 1.1 request, typically there are additional headers):
GET /foo/bar/fun.html HTTP/1.1 Host: www.origin.com
The server at
www.origin.comlooks up the Host: header to match that to a configuration section, usually referred to as a virtual host section. If the Host: header and configuration section match, the search continues for the content of the path
/foo/bar/fun.html, in the example, this is a file that contains
<html><body>This is a fun file</body></html>, so the server responds with the following:
HTTP/1.1 200 OK Content-Type: text/html; charset=UTF-8 Content-Length: 45 <html><body>This is a fun file</body></html>
At this point, HTTP transaction is complete.