The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+9 votes
1.7k views

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$
asked in Web Technologies by Veteran (97.7k points) | 1.7k views
+2
0

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

3 Answers

+12 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.
answered by Veteran (414k points)
selected by
+1
sir by default HTTP is persistent, if it is given non-persistent HTTP then what about TCP
0

It seems to be correct what you have written. BUT

Observe.

In question it is given that HTML page has exactly one image.

So we need exactly one single request.

But It seems that my claim doesn't match with correct answer.

So provide insight where my observation or logic needs more clarity.

Thanks.

0
Do graphical browers use persistent connection ?
+1
@Arjun sir,

Why not option c..i.e a single request from q to s is sufficient.
0
why not option c?
0
Why at least 2 http request is required when we have only one static embedded image on server?
+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.
answered by Loyal (9.3k points)
0
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
copied  from GeeksforGeeks
0 votes

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. 

 

answered by (189 points)
Answer:

Related questions

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
49,811 questions
54,540 answers
188,429 comments
75,603 users