Question
A graphical HTML browser resident at a network client machine Q accesses a static HTML webpage from a HTTP server S. The static HTML page has exactly one static embedded image which is also at S. Assuming no caching, which one of the following is correct about the HTML webpage loading (including the embedded image)?
Official answer and solution
- Official answer
- B
- From
- Official GATE 2014 answer key
Solution
Recall the client-server request-response architecture of HTTP and the operation of persistent TCP connections in HTTP/1.1.
-
Number of HTTP Requests:
- The client browser first sends an HTTP GET request to fetch the static HTML webpage.
- After parsing the HTML document, the browser discovers the embedded image tag pointing to an image on server S.
- The browser must issue a second HTTP GET request to fetch the image.
- Therefore, at least 2 HTTP requests must be sent.
-
TCP Connection Usage:
- In HTTP/1.0 without persistence, each request required opening a separate TCP connection.
- In HTTP/1.1 (the standard default), persistent connections allow multiple HTTP requests and responses to be sent sequentially over a single established TCP connection.
- Thus, a single TCP connection to server S is sufficient to deliver both requests.
-
Conclusion:
Q needs to send at least 2 HTTP requests to S, but a single TCP connection to server S is sufficient, which matches option (B).
B
Believing an HTML page automatically transfers its embedded images in a single HTTP response without requiring separate GET requests.
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2014 Computer Science and Information Technology (CS) Session 2
- Question
- 38 of 65, printed as CS Q.28
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.