H3G3moKnight
H3G3moKnight

Reputation: 123

How many HTTP get() request are needed to render a single web page? one or many?

When an HTTP get() request is sent from client to server, does the server only send HTML source code to the browser initially, leaving the browser to request from the server at a later time the web objects that make up the web page, in a sequential fashion as it processes the HTML? This would imply that N HTTP get() request are needed to render a single web page, one get request for each N objects that make up a web page.

Or, upon receiving the HTTP get request, does the server send the HTML source code and all web objects needed to render the web page to a client side cache, leaving the browser to render the web page locally as it process the HTML code sequentially? This would imply that a single HTTP get request is needed to render any web page. Thank You.

Upvotes: 1

Views: 3991

Answers (1)

Heinz Schilling
Heinz Schilling

Reputation: 2252

For every item embedded in the html webpage like image, css or javascript is a additional request needed: https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol

An HTTP session is a sequence of network request-response transactions. An HTTP client initiates a request by establishing a Transmission Control Protocol (TCP) connection to a particular port on a server (typically port 80, occasionally port 8080; see List of TCP and UDP port numbers). An HTTP server listening on that port waits for a client's request message. Upon receiving the request, the server sends back a status line, such as "HTTP/1.1 200 OK", and a message of its own. The body of this message is typically the requested resource, although an error message or other information may also be returned.

This change in HTTP/2: https://en.wikipedia.org/wiki/HTTP/2

Upvotes: 2

Related Questions