Web Technology Basics

From a web server with an RTT of 40 ms, one HTML file and the four images it references are fetched one after another. Assume that establishing a TCP connection takes one round trip and each request and response take one round trip, and ignore data transfer time, server processing time, TLS and connection teardown. Which of the following is the difference in total time between opening a new TCP connection for each object and reusing one TCP connection (a persistent connection)?

  1. A160 ms
  2. B200 ms
  3. C400 ms
Show answer and explanation

Answer: A. 160 ms

There are five objects in total. With a new connection each time, each object takes two round trips, one for connection setup and one for the request and response, giving 5 × 2 × 40 = 400 ms. With a persistent connection, the connection is set up only once at the start, followed by just the five requests and responses, giving (1 + 5) × 40 = 240 ms. The difference is 400 − 240 = 160 ms, which is the four connection setups saved. In HTTP/1.1, persistent connections are the default behavior.

  • A. Correct. 400 − 240 = 160 ms; four connection setups are saved.
  • B. This takes the five connection setups, 5 × 40 = 200 ms, as the difference. Even a persistent connection needs one connection setup at the start.
  • C. This is the total time when connecting each time, 5 × 2 × 40 = 400 ms, not the difference.
Practice this topic Back to topic

Books on Web Technology Basics Ad

As an Amazon Associate I earn from qualifying purchases.

More Web Technology Basics questions

  1. HTTP is a stateless protocol. Which of the following correctly describes what this means together with the usual way a website keeps a user logged in?
  2. Which of the following correctly describes the cookie set by the header above?
  3. Which of the following correctly describes a difference between the browser's localStorage and cookies?
  4. Three application servers are placed behind a load balancer, which distributes requests to them in turn (round robin). The session information of a logged-in user is stored only in the memory of the server that handled the login. Which of the following is an appropriate pair of a likely problem and its countermeasure?
  5. Which of the following correctly describes a typical signed JWT (JSON Web Token)?