标签:des style blog http os io java ar for
大致意思就是:如果有cache就直接显示。否则就在本机找IP,通过DNS找到IP并返回给浏览器。然后浏览器通过TCP和server之间沟通,server返回数据或者错误信息。然后就把数据render到browser。
例如我要打开facebook.com,值得一提的两点:一是可能会重定向网页,如从http://facebook.com到http://www.facebook.com。二是发送的http GET请求里是包含cookie的
关于页面的图片,音频,视频的加载顺序,可以自定义来提高初始加载速度。
In an extremely rough and simplified sketch, assuming the simplest possible HTTP request, no proxies and IPv4 (this would work similarly for IPv6-only client, but I have yet to see such workstation):
Again, discussion of each of these points have filled countless pages; take this as a starting point. Also, there are many other things happening in parallel to this (processing typed-in address, 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, etc.).
**************************************************************************************************************************************************************************
First the computer looks up the destination host. If it exists in local DNS cache, it uses that information. Otherwise, DNS querying is performed until the IP address is found.
Then, your browser opens a TCP connection to the destination host and sends the request according to HTTP 1.1 (or might use HTTP 1.0, but normal browsers don‘t do it any more).
The server looks up the required resource (if it exists) and responds using HTTP protocol, sends the data to the client (=your browser)
The browser then uses HTML parser to re-create document structure which is later presented to you on screen. If it finds references to external resources, such as pictures, css files, javascript files, these are is delivered the same way as the HTML document itself.
Reference:
http://stackoverflow.com/questions/2092527/what-happens-when-you-type-in-a-url-in-browser
http://fex.baidu.com/blog/2014/05/what-happen/
标签:des style blog http os io java ar for
原文地址:http://blog.csdn.net/he_wolf/article/details/39135135