最近看到 http response 的状态码, 说302 是 moved permanently, 301 是 moved temporarily.
想彻底搞清楚它们本质的区别, 仔细去看了它们的 Response:
-
访问 changchen.me 的响应(301):
HTTP/1.1 301 Moved Permanently
Server: nginx/1.10.3 (Ubuntu)
Date: Sun, 13 Aug 2017 05:37:04 GMT
Content-Type: text/html
Content-Length: 194
Connection: keep-alive
Location: https://changchen.me/ -
访问 www.changchen.me 的响应(302):
HTTP/1.1 302 Moved Temporarily
Server: nginx/1.10.3 (Ubuntu)
Date: Sun, 13 Aug 2017 05:38:23 GMT
Content-Type: text/html
Content-Length: 170
Connection: keep-alive
Location: https://changchen.me/
但问题来了, 它们唯一的区别只有第一行 O.O, 那他们的区别到底是什么呢?
功能上好像是完全一样的, 只是告诉客户端是永久还是临时跳转吗?
谢谢~~
ps. 还有大家要是工作了, 做 web 开发, 还会去仔细研究一下 TCP/IP, HTTP, HTTPS 等协议吗?
有什么好的学习资料或书推荐的吗?
