Http请求的流程
1、域名解析,通过路由分组转发数据到server
2、http是基于tcp/ip的application layer的protocol,故首先建立tcp连接,再发送请求信息。
3、server response corresponding resource after receiving request
4、browser explain the resource after get response from server
ReMark:
in http 1.0 version, both side will build a connection with each other per client request, and set connection free after process the request. So, if there are many pictures、music、movies etc, they'll build a connection high frequently, affectting performance.(服务器返回信息并不直接包含图片,而是返回一个图片的链接,当浏览器解析该图片时,才会再次向服务器发出一个请求。) 而在http1.1中,一次连接中可以处理多个请求,并且多个请求可以重叠进行(即不必等待上一个请求完成就发送新的请求)。只有在一段时间内没有新的请求,才会释放连接。
//所以链接css、javascript等也一样是多次请求
可以使用wireShark查看协议包的具体内容
Mark:
参考自:http://blog.csdn.net/tongdoudpj/archive/2008/07/07/2619403.aspx
现代足球中场兼进球,兼防守扫荡。软件开发也要求产品意识,质量测试。