in Web Technologies
6,801 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$
in Web Technologies
6.8k views

2 Comments

edited by
2
2

i think answer should be A. this is because, it has explicitly been mentioned that no caching is there. this means that as soon as 1st request is processed, the server closes the connection right then. so client has to establish a new TCP connection, and consequently send a new http request. reference for the link is below.

https://nptel.ac.in/courses/106105081/40

0
0

3 Answers

15 votes
15 votes
Best answer
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
by

4 Comments

@Arjun sir,

Why not option c..i.e a single request from q to s is sufficient.
1
1
why not option c?
0
0
Why at least 2 http request is required when we have only one static embedded image on server?
0
0
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.

2 Comments

Whenever browser open a web page it will require multiple requests for multiple objects and they are served from same server than one tcp connection is enough for that.
0
0
copied  from GeeksforGeeks
0
0
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true