HTTP

HTTP

Tips

  • 301 vs 302
    • 301 Moved Permanently
    • 302 Found / Moved Temporarily
# 单位为秒
Cache-Control: public, max-age=3600
Expires: Thu, 01 Dec 2014 16:00:00 GMT

CORS

  • 默认允许头
    • Cache-Control
    • Content-Language
    • Content-Type
    • Expires
    • Last-Modified
    • Pragma
  • access-control-expose-headers - 控制暴露头
# 请求
Access-Control-Request-Headers: authorization
Access-Control-Request-Method: GET
# 响应
Access-Control-Allow-Headers: authorization
Access-Control-Allow-Methods: POST,GET
Access-Control-Allow-Origin: http://127.0.0.1:3000

HTTP2

QUIC