新增加的HTTP狀態碼 -- 103

IETF公佈了新的HTTP狀態碼-103, 總結一下就是提前預加載(css、js)文檔,提升用戶的訪問速度。

Summary: a new status code that lets the server send headers early, before the main headers. This helps with optimisations like preloading. Example from the document:

     HTTP/1.1 103 Early Hints
     Link: </main.css>; rel=preload; as=style

     HTTP/1.1 103 Early Hints
     Link: </style.css>; rel=preload; as=style
     Link: </script.js>; rel=preload; as=script

     HTTP/1.1 200 OK
     Date: Fri, 26 May 2017 10:02:11 GMT
     Content-Length: 1234
     Content-Type: text/html; charset=utf-8
     Link: </main.css>; rel=preload; as=style
     Link: </newstyle.css>; rel=preload; as=style
     Link: </script.js>; rel=preload; as=script

The client can start preloading the CSS and JavaScript before the main headers arrive. This is a nice optimisation.
There are various security risks with sending multiple headers to non-conforming clients hence: “Therefore, a server might refrain from sending Early Hints over HTTP/1.1 unless the client is known to handle informational responses correctly.”

在頭部信息到達之前,用戶可以開始預加載CSS和JavaScript文件,這是一個很好的優化。
因此,向不合格的客戶機發送多個標頭存在各種各樣的安全風險:“因此,如果客戶不知道正確處理信息響應,服務器可能會避免發送HTTP / 1.1的早期提示。”

本段英文引入地址

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章