RFC2616 HTTP/1.1 Reading Notes

2,018 views
1,886 views

Published on

Recently I finished reading the rfc2616, and have many gains to share

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,018
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
35
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

RFC2616 HTTP/1.1 Reading Notes

  1. 1. RFC2616 HTTP/1.1<br />
  2. 2. Agenda<br />RFC2616 HTTP/1.1概述<br />基础术语和概念<br />缓存<br />工具<br />讨论<br />
  3. 3. RFC2616 HTTP/1.1概述<br />The Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed, collaborative, hypermedia information systems.<br />RFC2616<br />21个章节<br />协议参数、消息、请求、响应、实体、连接、方法、状态码、缓存、Header<br />
  4. 4. 基础术语和概念<br />连接、消息、请求、响应、资源、实体、表述、内容协商、变量、客户端、User Agent、代理、网关、隧道、缓存、可缓存、显式过期时间、启发式过期时间、语义透明、证言(Validator)<br />
  5. 5. 基础术语和概念<br />HTTP Operation<br />Request<br />User<br />Agent<br />Origin<br />Server<br />Response<br />Request chain<br />User<br />Agent<br />Origin<br />Server<br />Response chain<br />Intermediaries: Proxies, gateways, tunnels<br />
  6. 6. 基础术语和概念<br />协议的基本形式<br />
  7. 7. 基础术语和概念<br />协议的基本形式(Augmented BNF)<br />Name=definition(1#element)<br />协议的主要组成<br />Request Message<br />Response Message<br />
  8. 8. 基础术语和概念<br />Request<br />Response<br />
  9. 9. 基础术语和概念<br />REQUEST中的方法<br />OPTIONS<br />GET<br />HEAD<br />POST<br />PUT<br />DELETE<br />TRACE<br />CONNECT<br />
  10. 10. Status Code 状态码<br />1xx 信息性<br />2xx 成功性<br />3xx 重定向<br />4xx 客户端错误<br />5xx 服务端错误<br />
  11. 11. HTTP缓存<br />Caching would be useless if it did not significantly improve performance.<br />HTTP/1.1中缓存的目的<br />尽量减少发送请求的需求,“截止”机制<br />尽量减少发送完整响应的需求,“证实”机制<br />缓存的正确性<br />与原始服务器检查是等效的<br />“足够新”满足服务器对于更新的需要<br />适当的304、305或错误(4x,5x)响应消息<br />
  12. 12. Expiration Model<br />Server-specified Expiration<br />Expires<br />Cache-Control: max-age<br />Heuristic Expiration 启发式截止<br />Last-Modified<br />
  13. 13. Expiration Model<br />Age Calculation<br />Now – data_value<br />Age value<br />Expiration Calculation<br />Max-age 优先级高于 Expires<br />有max-age<br />没有max-age<br />
  14. 14. Cache-Control<br />Cache-Control:max-age=0<br />Cache-Contro:no-cache<br />
  15. 15. Expiration Model<br />
  16. 16. Validation Model<br />Last-Modified Dates<br />Entity Tag Cache Validators - ETag<br />Weak and Strong Validators<br />强证言:实体或Header变化,证言就发生变化<br />弱证言:只在语义改变明显时发生变化<br />
  17. 17. 工具<br />工具的用途<br />常见工具<br />Firefox Extension Live HTTP Headers<br />IE Http Watch<br />Chrome Developer Tools<br />
  18. 18. Live HTTP headers<br />
  19. 19. IE HtppWATCH<br />
  20. 20. ChROME<br />
  21. 21. 展望<br />Browser Caching<br />不同服务器缓存类配置比较<br />缓存的运维控制<br />
  22. 22. 参考资料<br />FRC2616 HTTP/1.1<br />Backus–Naur_Form<br />RFC822 Standard for ARPA Internet Text Message<br />

×