Page 154 - Web性能权威指南
P. 154

HTTP  1.1 标准厘清了之前版本中很多有歧义的地方,而且还加入了很多重要的性能
                 优化:持久连接、分块编码传输、字节范围请求、增强的缓存机制、传输编码及请
                 求管道。

                 有了这些新功能,我们就可以像任何当前的 HTTP 浏览器和客户端一样检视 HTTP
                 1.1 会话:

                     $> telnet website.org 80

                     Connected to xxx.xxx.xxx.xxx
                     GET /index.html HTTP/1.1 ➊
                     Host: website.org
                     User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4)... (snip)
                     Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
                     Accept-Encoding: gzip,deflate,sdch
                     Accept-Language: en-US,en;q=0.8
                     Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
                     Cookie: __qca=P0-800083390... (snip)
                     HTTP/1.1 200 OK ➋
                     Server: nginx/1.0.11
                     Connection: keep-alive
                     Content-Type: text/html; charset=utf-8
                     Via: HTTP/1.1 GWA
                     Date: Wed, 25 Jul 2012 20:23:35 GMT
                     Expires: Wed, 25 Jul 2012 20:23:35 GMT
                     Cache-Control: max-age=0, no-cache
                     Transfer-Encoding: chunked
                     100 ➌
                     <!doctype html>
                     (snip)

                     100
                     (snip)

                     0 ➍
                     GET /favicon.ico HTTP/1.1 ➎
                     Host: www.website.org
                     User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4)... (snip)
                     Accept: */*
                     Referer: http://website.org/
                     Connection: close ➏
                     Accept-Encoding: gzip,deflate,sdch
                     Accept-Language: en-US,en;q=0.8
                     Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
                     Cookie: __qca=P0-800083390... (snip)

                     HTTP/1.1 200 OK ➐
                     Server: nginx/1.0.11


                                                                            HTTP简史   |   139
   149   150   151   152   153   154   155   156   157   158   159