idnits 2.17.1 draft-ietf-httpbis-early-hints-03.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (June 20, 2017) is 2500 days in the past. Is this intentional? Checking references for intended status: Experimental ---------------------------------------------------------------------------- ** Obsolete normative reference: RFC 7230 (Obsoleted by RFC 9110, RFC 9112) ** Obsolete normative reference: RFC 7231 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 7540 (Obsoleted by RFC 9113) Summary: 3 errors (**), 0 flaws (~~), 1 warning (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 HTTP Working Group K. Oku 3 Internet-Draft Fastly 4 Intended status: Experimental June 20, 2017 5 Expires: December 22, 2017 7 An HTTP Status Code for Indicating Hints 8 draft-ietf-httpbis-early-hints-03 10 Abstract 12 This memo introduces an informational HTTP status code that can be 13 used to convey hints that help a client make preparations for 14 processing the final response. 16 Note to Readers 18 Discussion of this draft takes place on the HTTP working group 19 mailing list (ietf-http-wg@w3.org), which is archived at 20 https://lists.w3.org/Archives/Public/ietf-http-wg/ . 22 Working Group information can be found at https://httpwg.github.io/ ; 23 source code and issues list for this draft can be found at 24 https://github.com/httpwg/http-extensions/labels/early-hints . 26 Status of This Memo 28 This Internet-Draft is submitted in full conformance with the 29 provisions of BCP 78 and BCP 79. 31 Internet-Drafts are working documents of the Internet Engineering 32 Task Force (IETF). Note that other groups may also distribute 33 working documents as Internet-Drafts. The list of current Internet- 34 Drafts is at http://datatracker.ietf.org/drafts/current/. 36 Internet-Drafts are draft documents valid for a maximum of six months 37 and may be updated, replaced, or obsoleted by other documents at any 38 time. It is inappropriate to use Internet-Drafts as reference 39 material or to cite them other than as "work in progress." 41 This Internet-Draft will expire on December 22, 2017. 43 Copyright Notice 45 Copyright (c) 2017 IETF Trust and the persons identified as the 46 document authors. All rights reserved. 48 This document is subject to BCP 78 and the IETF Trust's Legal 49 Provisions Relating to IETF Documents 50 (http://trustee.ietf.org/license-info) in effect on the date of 51 publication of this document. Please review these documents 52 carefully, as they describe your rights and restrictions with respect 53 to this document. Code Components extracted from this document must 54 include Simplified BSD License text as described in Section 4.e of 55 the Trust Legal Provisions and are provided without warranty as 56 described in the Simplified BSD License. 58 Table of Contents 60 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 61 1.1. Notational Conventions . . . . . . . . . . . . . . . . . 3 62 2. 103 Early Hints . . . . . . . . . . . . . . . . . . . . . . . 3 63 3. Security Considerations . . . . . . . . . . . . . . . . . . . 4 64 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5 65 5. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 5 66 6. Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 67 6.1. Since draft-ietf-httpbis-early-hints-02 . . . . . . . . . 5 68 6.2. Since draft-ietf-httpbis-early-hints-01 . . . . . . . . . 5 69 6.3. Since draft-ietf-httpbis-early-hints-00 . . . . . . . . . 5 70 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 5 71 7.1. Normative References . . . . . . . . . . . . . . . . . . 5 72 7.2. Informative References . . . . . . . . . . . . . . . . . 6 73 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 6 75 1. Introduction 77 It is common for HTTP responses to contain links to external 78 resources that need to be fetched prior to their use; for example, 79 rendering HTML by a Web browser. Having such links available to the 80 client as early as possible helps to minimize perceived latency. 82 The "preload" ([Preload]) link relation can be used to convey such 83 links in the Link header field of an HTTP response. However, it is 84 not always possible for an origin server to generate the header block 85 of a final response immediately after receiving a request. For 86 example, the origin server might delegate a request to an upstream 87 HTTP server running at a distant location, or the status code might 88 depend on the result of a database query. 90 The dilemma here is that even though it is preferable for an origin 91 server to send some header fields as soon as it receives a request, 92 it cannot do so until the status code and the full header fields of 93 the final HTTP response are determined. 95 HTTP/2 ([RFC7540]) server push can be used as a solution to this 96 issue, but has its own limitations. The responses that can be pushed 97 using HTTP/2 are limited to those belonging to the same origin. 98 Also, it is impossible to send only the links using server push. 99 Finally, sending HTTP responses for every resource is an inefficient 100 way of using bandwidth, especially when a caching server exists as an 101 intermediary. 103 This memo defines a status code for sending an informational response 104 ([RFC7231], Section 6.2) that contains header fields that are likely 105 to be included in the final response. A server can send the 106 informational response containing some of the header fields to help 107 the client start making preparations for processing the final 108 response, and then run time-consuming operations to generate the 109 final response. The informational response can also be used by an 110 origin server to trigger HTTP/2 server push at a caching 111 intermediary. 113 1.1. Notational Conventions 115 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 116 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 117 document are to be interpreted as described in [RFC2119]. 119 2. 103 Early Hints 121 The 103 (Early Hints) informational status code indicates to the 122 client that the server is likely to send a final response with the 123 header fields included in the informational response. 125 A server MUST NOT include Content-Length, Transfer-Encoding, or any 126 hop-by-hop header fields ([RFC7230], Section 6.1) in a 103 (Early 127 Hints) response. 129 A client can speculatively evaluate the header fields included in a 130 103 (Early Hints) response while waiting for the final response. For 131 example, a client might recognize a Link header field value 132 containing the relation type "preload" and start fetching the target 133 resource. 135 However, these header fields only provide hints to the client; they 136 do not replace the header fields on the final response. Aside from 137 performance optimizations, such evaluation of the 103 (Early Hints) 138 response's header fields MUST NOT affect how the final response is 139 processed. A client MUST NOT interpret the 103 (Early Hints) 140 response header fields as if they applied to the informational 141 response itself (e.g., as metadata about the 103 (Early Hints) 142 response). 144 An intermediary MAY drop the informational response. It MAY send 145 HTTP/2 ([RFC7540]) server pushes using the information found in the 146 103 (Early Hints) response. 148 The following example illustrates a typical message exchange that 149 involves a 103 (Early Hints) response. 151 Client request: 153 GET / HTTP/1.1 154 Host: example.com 156 Server response: 158 HTTP/1.1 103 Early Hints 159 Link: ; rel=preload; as=style 160 Link: ; rel=preload; as=script 162 HTTP/1.1 200 OK 163 Date: Fri, 26 May 2017 10:02:11 GMT 164 Content-Length: 1234 165 Content-Type: text/html; charset=utf-8 166 Link: ; rel=preload; as=style 167 Link: ; rel=preload; as=script 169 170 [... rest of the response body is ommitted from the example ...] 172 3. Security Considerations 174 Some clients might have issues handling 103 (Early Hints), since 175 informational responses are rarely used in reply to requests not 176 including an Expect header ([RFC7231], Section 5.1.1). 178 In particular, an HTTP/1.1 client that mishandles an informational 179 response as a final response is likely to consider all responses to 180 the succeeding requests sent over the same connection to be part of 181 the final response. Such behavior may constitute a cross-origin 182 information disclosure vulnerability in case the client multiplexes 183 requests to different origins onto a single persistent connection. 185 Therefore, a server might refrain from sending Early Hints over 186 HTTP/1.1 unless when the client is known to handle informational 187 responses correctly. 189 HTTP/2 clients are less likely to suffer from incorrect framing since 190 handling of the response header fields does not affect how the end of 191 the response body is determined. 193 4. IANA Considerations 195 The HTTP Status Codes Registry will be updated with the following 196 entry: 198 o Code: 103 200 o Description: Early Hints 202 o Specification: [this document] 204 5. Acknowledgements 206 Thanks to Tatsuhiro Tsujikawa for coming up with the idea of sending 207 the Link header fields using an informational response. 209 6. Changes 211 6.1. Since draft-ietf-httpbis-early-hints-02 213 o Editorial changes. 215 o Added an example. 217 6.2. Since draft-ietf-httpbis-early-hints-01 219 o Editorial changes. 221 6.3. Since draft-ietf-httpbis-early-hints-00 223 o Forbid processing the headers of a 103 response as part of the 224 informational response. 226 7. References 228 7.1. Normative References 230 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 231 Requirement Levels", BCP 14, RFC 2119, 232 DOI 10.17487/RFC2119, March 1997, 233 . 235 [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 236 Protocol (HTTP/1.1): Message Syntax and Routing", 237 RFC 7230, DOI 10.17487/RFC7230, June 2014, 238 . 240 [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 241 Protocol (HTTP/1.1): Semantics and Content", RFC 7231, 242 DOI 10.17487/RFC7231, June 2014, 243 . 245 [RFC7540] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext 246 Transfer Protocol Version 2 (HTTP/2)", RFC 7540, 247 DOI 10.17487/RFC7540, May 2015, 248 . 250 7.2. Informative References 252 [Preload] Grigorik, I., "Preload", n.d., . 255 Author's Address 257 Kazuho Oku 258 Fastly 260 Email: kazuhooku@gmail.com