HTTP,协议,学习总结

  1. 消息格式: start line + headers + body
    Request Message:

<method> <request-URL> <version>
<headers>
<entity-body>

Repsonse Message:
<version> <status> <reason-phrase>
<headers>
<entity-body>
2.一共7种Method
HTTP,协议,学习总结

  1. 一共5大类Status Code
    HTTP,协议,学习总结

4.基于TCP的HTTP问题
如果采用TCP短连接会带来较大的延迟,原因:

  • TCP 三次握手(handshake)
  • TCP 延时确认(delay ack)
  • TCP 慢启动(slow start)
  • 服务器端频繁关闭TCP,导致TIME_WAIT Accumulation and Port Exhaustion

解决办法:

  • Parallel connections
    Concurrent HTTP requests across multiple TCP connections
    并行多TCP连接,
  • Persistent connections
    Reusing TCP connections to eliminate connect/close delays
    共有一个TCP长连接,HTTP/1.1 默认为长连接
    消除TCP connection延时
    delays
  • Pipelined connections
    Concurrent HTTP requests across a shared TCP connection
    消除数据传输延时(transfer latencies)
  • Multiplexed connections
    Interleaving chunks of requests and responses (experimental)

    1. 缓存控制
      HTTP,协议,学习总结
      HTTP,协议,学习总结

不缓存!
Cache-Control: no-store
Cache-Control: no-cache do-notserve-from-cache-without-revalidation.
Pragma: no-cache
Cache-Control: must-revalidate

转载于:https://blog.51cto.com/xwandrew/2083336

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值