当您在浏览器中键入URL会发生什么 [英] what happens when you type in a URL in browser

查看:175
本文介绍了当您在浏览器中键入URL会发生什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人能告诉我什么都发生了,从我的网址在浏览器中,当我看到在浏览器页面的时候输入时间在幕后?详细交代过程中会有很大的帮助。

Can somebody tell me what all happens behind the scenes from the time I type in a URL in the browser to the time when I get to see the page on the browser? A detailed account of the process would be of great help.

推荐答案

在一个极其粗糙,简单的素描,假设一个最简单的HTTP请求,没有代理,IPv4和没有问题的任何一个步骤:

In an extremely rough and simplified sketch, assuming the simplest possible HTTP request, no proxies, IPv4 and no problems in any step:


  1. 浏览器缓存检查;如果请求的对象是在缓存中,是新鲜的,跳到#9

  2. 浏览器要求操作系统的服务器的IP地址

  3. 操作系统使得DNS查询和回复的IP地址,浏览器

  4. 浏览器打开一个TCP连接到服务器(这一步是更复杂的使用HTTPS)

  5. 浏览器会通过TCP连接HTTP请求

  6. 浏览器接收HTTP响应,可以关闭TCP连接或重用的另一个请求

  7. 浏览器检查响应是否重定向或条件响应(3XX结果状态codeS),授权请求(401),错误(4XX和5XX)等;这些都是正常的反应不同的处理(2XX)

  8. 如果缓存,响应被存储在高速缓存

  9. 浏览器去codeS响应(例如,如果它的gzip压缩)

  10. 浏览器将决定如何处理响应做(例如它是一个HTML页面,它是一个图像,它是一个声音片段?)

  11. 浏览器呈现的反应,或提供了一个下载对话框未确认类型

此外,每一个点的讨论,填补了无数页;借此只能作为一个简短的总结。此外,还有许多其他的事情并行发生的这个(加工键入的地址,投机prefetching,添加页面,浏览器历史记录,显示进度给用户,通知插件和扩展,呈现页面,而它的下载,流水线,连接保持有效跟踪,检查恶意内容等) - 以及整个操作变得更加级复杂的顺序使用HTTPS(证书和密码,并牵制,噢,我的)

Again, discussion of each of these points have filled countless pages; take this only as a short summary. Also, there are many other things happening in parallel to this (processing typed-in address, speculative prefetching, adding page to browser history, displaying progress to user, notifying plugins and extensions, rendering the page while it's downloading, pipelining, connection tracking for keep-alive, checking for malicious content etc.) - and the whole operation gets an order of magnitude more complex with HTTPS (certificates and ciphers and pinning, oh my!).

这篇关于当您在浏览器中键入URL会发生什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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