6,772 views
11 votes
11 votes

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)? 

  1. $Q$ needs to send at least 2 HTTP requests to $S$, each necessarily in a separate TCP connection to server $S$
  2. $Q$ needs to send at least 2 HTTP requests to $S$, but a single TCP connection to server $S$ is sufficient 
  3. A single HTTP request from $Q$ to $S$ is sufficient, and a single TCP connection between $Q$ and $S$ is necessary for this
  4. A single HTTP request from $Q$ to $S$ is sufficient, and this is possible without any TCP connection between $Q$ and $S$

3 Answers

Best answer
15 votes
15 votes
A separate HTML request must be send for each image or component in HTML like css file of js. But all can be done in same connection. So, (B) is the answer.
selected by
4 votes
4 votes

The answer is B.

Firstly, Q makes a TCP connection with S. 

After that, it sends the first request for the webpage. When it is received, it sees that there is also an image which needs to be picked up, so it makes another request to S for the image.

Then it may close the TCP connection. 

This is how it is done if we are using HTTP version 1.1( which is always used now). One connection, also called HTTP persistent connection, is enough to make several requests on the same server.

So, the answer is B.

Before 1.1, there used to be non-persistent connections wherein a client had to make and close N connections for N different requests. 

 

edited by
3 votes
3 votes
Whenever a browser opens a webpage, it makes a separate request for each object of page like image, css, javascript, etc. However if multiple resources are served from same server, then one TCP connect is sufficient.
Answer:

Related questions

2 votes
2 votes
1 answer
1
go_editor asked Jul 21, 2016
3,244 views
The _____ language was originally designed as the Transformation Language for Style Sheet FacilityXSTLXMLXQueryXPath
2 votes
2 votes
2 answers
2
Kathleen asked Sep 22, 2014
4,618 views
Consider a HTML table definition given below:<table border =1 <tr <td rowspan=2 ab </td <td colspan=2 cd </td </tr <tr <td ef </td <td rowspan=2 gh </td </tr <tr <td cols...
0 votes
0 votes
4 answers
3