You will trace server processing, explain name-based virtual hosting, decode an HTTP/1.1 chunked body, and decide whether a cached response may be reused. Readiness: what are the host, port, path, and query in a URL?
Two domains can share one server address, a response may arrive before its final size is known, and a cache may answer without contacting the origin. These are normal mechanisms, not contradictions.
An HTTP server accepts a connection or stream, parses a request, selects a virtual host and route, applies middleware/handlers, and writes a response. In HTTP/1.1, the Host field lets one address serve multiple domain configurations. HTTP/2 and HTTP/3 use different framing, but retain HTTP semantics such as methods, status codes, fields, and representations.
GET /news HTTP/1.1
Host: campus.example
Accept: text/html
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Cache-Control: max-age=60
Content-Length: 15
<h1>News</h1>
HTTP/1.1 chunked transfer coding writes each chunk size in hexadecimal, then data, and ends with a zero-size chunk:
4\r\nWiki\r\n
5\r\npedia\r\n
0\r\n\r\n
4 gives Wiki; hexadecimal 5 gives pedia; 0 ends the content. Result: Wikipedia. Chunked transfer coding is an HTTP/1.1 framing feature; do not describe HTTP/2 or HTTP/3 frames as chunked coding.
Cache-Control: max-age=60 permits a reusable response to remain fresh for 60 seconds, subject to other rules. A stale cached response may be revalidated with If-None-Match and an ETag; 304 Not Modified tells the cache to reuse its stored representation. no-store means do not store; it is not the same as no-cache, which allows storage but requires validation before reuse.
A cache stored a response at 10:00:00 with max-age=120. May it reuse it at 10:01:30? Hint: age is 90 seconds. Solution: yes, if no other directive invalidates reuse. At 10:02:30 it is stale and normally needs validation.
304 normally has no new representation body; the client uses its stored body.10 is hexadecimal 16, not decimal 10.Use curl -v https://example.com/ and identify request line, response status, fields, and body boundary. Then send two requests to a local HTTP server with different Host values and sketch how a server could route them. If no server is available, analyze the supplied raw messages instead of claiming execution.
Q1: What selects a name-based virtual host? Answer: the request authority/Host value plus server configuration.Q2: Can two domains share an IP address? Answer: yes.Q3: Decode chunks 3\r\nWeb\r\n2\r\n!!\r\n0. Answer: Web!!.Q4: no-cache versus no-store? Answer: validate before reuse versus do not store.Given three responses (max-age=300, no-cache with ETag, and no-store), write a decision table for first storage, reuse after 60 seconds, and reuse offline. Rubric: correct storage 3, freshness/validation 3, offline reasoning 2, stated assumptions 2.
Request -> host/route selection -> handler -> response. Cache freshness is a decision, not a synonym for “old file.”