What can be the most appropriate answer for this HTTP Problem

  • Thread starter 22990atinesh
  • Start date
  • Tags
    Html
In summary, the most appropriate answer for this HTTP problem would depend on the specific error code and context in which it occurred. Some possible solutions could include checking for server or network errors, ensuring proper authentication, or troubleshooting incorrect client requests. It is important to carefully analyze the error code and any accompanying information to determine the best course of action for resolving the issue.
  • #1
22990atinesh
143
1

Homework Statement


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

(A) Q needs to send at least 2 HTTP requests to S, each necessarily in a separate TCP connection to server S
(B) Q needs to send at least 2 HTTP requests to S, but a single TCP connection to server S is sufficient
(C) A single HTTP request from Q to S is sufficient, and a single TCP connection between Q and S is necessary for this
(D) A single HTTP request from Q to S is sufficient, and this is possible without any TCP connection between Q and S

Homework Equations

The Attempt at a Solution


I think only 1 http request and 1 tcp connection is enough. First Q sends an http request to H, then a tcp connection will be established between Q and H. Then H will send an http response having static HTML webpage to Q. Hence (C)
 
Physics news on Phys.org
  • #2
your client browser having processed the html for display must still request the image too right?
 
  • #3
jedishrfu said:
your client browser having processed the html for display must still request the image too right?
Since the image is embedded in the html page, my thought (which very well could be wrong) is that a single GET request would suffice without a TCP connection being needed. The payload of the GET request could be broken up into multi-part MIME to represent the text content of the HTML page and the binary portion that is the image.
 
  • #4
If you're using a browser such as Chrome, you could open the Dev window right now and watch it make the image requests.
 
  • #5
DaveC426913 said:
If you're using a browser such as Chrome, you could open the Dev window right now and watch it make the image requests.
Chrome, Firefox, IE and possibly other browsers have debugging windows, available by pressing F12. One of the options is to view network traffic, such as HTTP requests and responses.
 
  • #6
Another way to study this is to install and run a local web server on your own computer. Many people do this under Windows using a WAMP (Windows, Apache, MySQL, PHP) package, or (like me) under Mac OS using a MAMP package. Then you can code a simple test page, call it up in your browser using an address like http://localhost/yourpage.html , and examine the server log file to see exactly which requests it received.
 
Last edited by a moderator:
  • #7
or you could use node.js to deliver your web page but I think building a web server is overkill for this question. As others have pointed out the debugger feature of most browsers would be sufficient.
 
  • #8
with respect to the static embedded image I thought it meant that an img tag was used to reference an image as is commonly done.

However, there is a technique to truly embed an image in a webpage using the image tag as a coded base64 hexadecimal string eliminating the request for the image.

The caveat is that people use this trick for small icon images as larger images will make the web page much larger making a request take far longer to download than if you simply downloaded the image in binary. Recall that base64 hexadecimal will use two bytes to represent one binary byte.
 
  • #9
jedishrfu said:
with respect to the static embedded image I thought it meant that an img tag was used to reference an image as is commonly done.

However, there is a technique to truly embed an image in a webpage using the image tag as a coded base64 hexadecimal string eliminating the request for the image.
This is what I had in mind as being an embedded image.
jedishrfu said:
The caveat is that people use this trick for small icon images as larger images will make the web page much larger making a request take far longer to download than if you simply downloaded the image in binary. Recall that base64 hexadecimal will use two bytes to represent one binary byte.
 
  • #10
Hello jedishrfu, I used Fiddler and it clear my concept. 2 HTTP request and 1 TCP connection will be needed.
One more thing, I want to ask. As Browser sends http request for a webpage, It gets html code in response. It then parse the code and again by default send the http request for the images. But at the same time for some hyperlinks it waits for the client to click on it. For what sort of files browser by default sends http request and for what it does'nt.
 
Last edited:
  • #11
If the html uses the link tag then the web browser will wait until you click on the link. There may be other instances of where things aren't download too.

One, I can think of is javascript code connected to a button or mouse over event that once activated then a request is sent. Another is when a delay timer expires and some javascript code then sends a request. These tricks are often used to bypass web browser protections about opening excessive windows which drive endusers crazy...

http://www.w3schools.com/tags/tag_link.asp

Here's something of interest on Responsive Web Design which talks very briefly about the link tag:

http://en.wikipedia.org/wiki/Responsive_web_design
 

Related to What can be the most appropriate answer for this HTTP Problem

1. What is an HTTP problem?

An HTTP (Hypertext Transfer Protocol) problem refers to any issue or error that occurs while using the HTTP protocol to communicate between a client (such as a web browser) and a server (such as a website). These problems can range from simple errors, such as a broken link or incorrect URL, to more complex issues, such as server errors or network connectivity problems.

2. What can cause an HTTP problem?

There are many potential causes of an HTTP problem, including server issues, network problems, client-side errors, and incorrect coding. Some common causes include server overloading, incorrect server configurations, DNS errors, and browser compatibility issues.

3. How can I troubleshoot an HTTP problem?

To troubleshoot an HTTP problem, there are a few steps you can take. First, check the URL to make sure it is correct and try refreshing the page. If that doesn't work, try clearing your browser's cache and cookies. If the problem persists, try accessing the website on a different browser or device. If the issue still persists, it may be a server or network issue, in which case you may need to contact the website's administrator or your internet service provider for further assistance.

4. Can an HTTP problem be fixed?

In most cases, an HTTP problem can be fixed. As mentioned earlier, there are several potential causes for these problems, and the solution will depend on the specific issue. In some cases, simply refreshing the page or clearing your browser's cache can resolve the problem. However, if the issue is on the server-side, it may require the website's administrator to make changes or updates. In more complex cases, it may take a combination of troubleshooting steps to resolve the problem.

5. How can I prevent HTTP problems in the future?

To prevent HTTP problems, it is important to ensure that all elements of your website (such as links, images, and scripts) are properly coded and functioning correctly. Additionally, regularly monitoring your server and network can help identify and resolve any potential issues before they become larger problems. It is also important to stay up to date with the latest browser versions and technologies to ensure compatibility with your website.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
4
Views
1K
Replies
7
Views
329
  • Math Proof Training and Practice
Replies
20
Views
4K
  • Computing and Technology
Replies
1
Views
7K
  • Programming and Computer Science
Replies
2
Views
2K
  • Introductory Physics Homework Help
Replies
20
Views
9K
Replies
9
Views
8K
  • Biology and Chemistry Homework Help
Replies
5
Views
3K
  • Introductory Physics Homework Help
Replies
2
Views
21K
Back
Top