呈现一个网页需要多少个HTTP get()请求?一个或多个? [英] How many HTTP get() request are needed to render a single web page? one or many?

查看:127
本文介绍了呈现一个网页需要多少个HTTP get()请求?一个或多个?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当HTTP get()请求从客户端发送到服务器时,服务器最初是否仅向浏览器发送HTML源代码,而使浏览器稍后再​​向服务器请求构成Web的Web对象.页,以连续的方式处理HTML?这意味着要呈现单个网页,需要 N 个HTTP get()请求,对于构成网页的每个 N 个对象,都需要一个get请求.

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.

或者,在接收到HTTP get请求后,服务器是否将HTML源代码和呈现网页所需的所有Web对象发送到客户端缓存,而让浏览器在处理HTML时在本地呈现网页顺序编码?这意味着只需要一个HTTP get请求即可呈现任何网页.谢谢.

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.

推荐答案

对于html网页中嵌入的每个项目(例如图片),css或javascript都是一个附加请求: https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol

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

HTTP会话是网络请求-响应的序列交易.HTTP客户端通过建立一个与特定端口上的传输控制协议(TCP)连接服务器(通常为端口80,偶尔为端口8080;请参阅TCP列表)和UDP端口号).正在侦听该端口的HTTP服务器正在等待客户的请求消息.收到请求后,服务器发送回状态行,例如"HTTP/1.1 200 OK",并显示一条消息它自己的.该消息的正文通常是请求的资源,尽管也可能会返回错误消息或其他信息.

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.

HTTP/2中的此更改: https://en.wikipedia.org/wiki/HTTP/2

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

这篇关于呈现一个网页需要多少个HTTP get()请求?一个或多个?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆