浏览器/服务器如何协同工作来显示 html 页面?
我经常被问到这个问题=/
但我只知道如何在非常高的水平上回答它。
从用户输入 URL 并按回车键的那一刻起,客户端和服务器端会发生什么,请求/响应如何工作?服务器如何与 CGI/解释器交互?
如果您可以将我引导至包含此详细信息的 URL,或者您可以回答该问题,也会很有帮助。
当我向人们描述这一点时,我总觉得他们在寻找细节,而我没有提供足够的细节。
谢谢!
I get this question a lot =/
But I only know how to answer it at a very high level.
From the minute a user enters a URL and hits enter, what happens on the client and server side, and how do requests/responses work? How does the server interact with CGI/interpreters?
It would be helpful too if you could direct me to a URL that has this information in detail, or if you can answer it.
When I describe this to people I always feel like theyre looking for specifics and I'm not giving enough detail.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这也称为“无状态”,因为服务器在客户端收到响应流中的所有内容后关闭与客户端的通信。
因此,服务器无法知道客户端是否仍然连接,也无法知道客户端是否稍后返回。许多服务器确实使用 cookie 或类似的方式提供会话对象,以跟踪发送下一个 REQUEST 的客户端是否相同,如果是,则允许更“智能”的服务器响应 - 例如查找、事务和登录。
This is also called "stateless" as the server closes communication with client after the client has received everything from the reponse-stream.
Therefore the server cannot know if the client is still connected nor if its comming back later. Many servers does provide a session object using cookies or similar to track if its the same client that sends the next REQUEST and if so, allowing more "intelligent" server responses - such as seeking, transactions and logins.
互联网是如何工作的?
HTTP 变得非常简单
规范文档:RFC 2616
How does the internet work?
HTTP Made Really Easy
The Canonical Document: RFC 2616
客户端向服务器发送请求标头(通过 DNS 查找 IP)。
服务器软件(例如 Apache)在需要时调用 CGI 并准备响应。
它发送回标头以及内容。
The client sends request headers to the server (finds the IP via DNS).
The server software (e.g. Apache) calls CGI if it needs to and prepares the response.
It sends headers back as well as the content.