idnits 2.17.00 (12 Aug 2021) /tmp/idnits51114/draft-kazuho-httpbis-priority-00.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 (July 08, 2019) is 1048 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Outdated reference: draft-ietf-httpbis-header-structure has been published as RFC 8941 == Outdated reference: A later version (-34) exists of draft-ietf-quic-http-20 Summary: 0 errors (**), 0 flaws (~~), 3 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 HTTP K. Oku 3 Internet-Draft Fastly 4 Intended status: Standards Track L. Pardue 5 Expires: January 9, 2020 Cloudflare 6 July 08, 2019 8 The Priority HTTP Header Field 9 draft-kazuho-httpbis-priority-00 11 Abstract 13 This document describes the Priority HTTP header field. This header 14 field can be used by endpoints to specify the absolute precedence of 15 an HTTP response in an HTTP-version-independent way. 17 Status of This Memo 19 This Internet-Draft is submitted in full conformance with the 20 provisions of BCP 78 and BCP 79. 22 Internet-Drafts are working documents of the Internet Engineering 23 Task Force (IETF). Note that other groups may also distribute 24 working documents as Internet-Drafts. The list of current Internet- 25 Drafts is at http://datatracker.ietf.org/drafts/current/. 27 Internet-Drafts are draft documents valid for a maximum of six months 28 and may be updated, replaced, or obsoleted by other documents at any 29 time. It is inappropriate to use Internet-Drafts as reference 30 material or to cite them other than as "work in progress." 32 This Internet-Draft will expire on January 9, 2020. 34 Copyright Notice 36 Copyright (c) 2019 IETF Trust and the persons identified as the 37 document authors. All rights reserved. 39 This document is subject to BCP 78 and the IETF Trust's Legal 40 Provisions Relating to IETF Documents 41 (http://trustee.ietf.org/license-info) in effect on the date of 42 publication of this document. Please review these documents 43 carefully, as they describe your rights and restrictions with respect 44 to this document. Code Components extracted from this document must 45 include Simplified BSD License text as described in Section 4.e of 46 the Trust Legal Provisions and are provided without warranty as 47 described in the Simplified BSD License. 49 Table of Contents 51 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 52 1.1. Notational Conventions . . . . . . . . . . . . . . . . . 3 53 2. The Priority HTTP Header Field . . . . . . . . . . . . . . . 3 54 2.1. urgency . . . . . . . . . . . . . . . . . . . . . . . . . 4 55 2.2. progressive . . . . . . . . . . . . . . . . . . . . . . . 4 56 3. Merging Client- and Server-Driven Parameters . . . . . . . . 5 57 4. Coexistence with HTTP/2 Priorities . . . . . . . . . . . . . 6 58 4.1. The SETTINGS_HEADER_BASED_PRIORITY SETTINGS Parameter . . 6 59 5. Considerations . . . . . . . . . . . . . . . . . . . . . . . 6 60 5.1. Why use an End-to-End Header Field? . . . . . . . . . . . 6 61 5.2. Why are there Only Three Levels of Urgency? . . . . . . . 7 62 6. Security Considerations . . . . . . . . . . . . . . . . . . . 8 63 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 8 64 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 8 65 8.1. Normative References . . . . . . . . . . . . . . . . . . 8 66 8.2. Informative References . . . . . . . . . . . . . . . . . 9 67 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 9 68 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 9 70 1. Introduction 72 It is common for an HTTP ([RFC7230]) resource representation to have 73 relationships to one or more other resources. Clients will often 74 discover these relationships while processing a retrieved 75 representation, leading to further retrieval requests. Meanwhile, 76 the nature of the relationship determines whether the client is 77 blocked from continuing to process locally available resources. For 78 example, visual rendering of an HTML document could be blocked by the 79 retrieval of a CSS file that the document refers to. In contrast, 80 inline images do not block rendering and get drawn progressively as 81 the chunks of the images arrive. 83 To provide meaningful representation of a document at the earliest 84 moment, it is important for an HTTP server to prioritize the HTTP 85 responses, or the chunks of those HTTP responses, that it sends. 87 HTTP/2 ([RFC7540]) provides such a prioritization scheme. A client 88 sends a series of PRIORITY frames to communicate to the server a 89 "priority tree"; this represents the client's preferred ordering and 90 weighted distribution of the bandwidth among the HTTP responses. 91 However, the design has shortcomings: 93 o Its complexity has led to varying levels of support by HTTP/2 94 clients and servers. 96 o It is hard to coordinate with server-driven prioritization. For 97 example, a server, with knowledge of the document structure, might 98 want to prioritize the delivery of images that are critical to 99 user experience above other images, but below the CSS files. But 100 with the HTTP/2 prioritization scheme, it is impossible for the 101 server to determine how such images should be prioritized against 102 other responses that use the client-driven prioritization tree, 103 because every client builds the HTTP/2 prioritization tree in a 104 different way. 106 o It does not define a method that can be used by a server to 107 express the priority of a response. Without such a method, 108 intermediaries cannot coordinate client-driven and server-driven 109 priorities. 111 o The design cannot be ported cleanly to HTTP/3 112 ([I-D.ietf-quic-http]). One of the primary goals of HTTP/3 is to 113 minimize head-of-line blocking. Transmitting the evolving 114 representation of a "prioritization tree" from the client to the 115 server requires head-of-line blocking. 117 Based on these observations, this document defines the Priority HTTP 118 header field that can be used by both the client and the server to 119 specify the precedence of HTTP responses in a standardized, 120 extensible, protocol-version- independent, end-to-end format. This 121 header-based prioritization scheme can act as a substitute for the 122 HTTP/2 frame-based prioritization scheme (see Section 4). 124 1.1. Notational Conventions 126 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 127 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 128 document are to be interpreted as described in [RFC2119]. 130 The terms sh-token and sh-boolean are imported from 131 [I-D.ietf-httpbis-header-structure]. 133 Example HTTP requests and responses use the HTTP/2-style formatting 134 from [RFC7540]. 136 2. The Priority HTTP Header Field 138 The Priority HTTP header field can appear in requests and responses. 139 A client uses it to specify the priority of the response. A server 140 uses it to inform the client that the priority was overwritten. An 141 intermediary can use the Priority information from client requests 142 and server responses to correct or amend the precedence to suit it 143 (see Section 3). 145 The value of the Priority header field is a Structured Headers 146 [I-D.ietf-httpbis-header-structure] Dictionary. Each dictionary 147 member represents a parameter of the Priority header field. This 148 document defines the "urgency" and "progressive" parameters. Values 149 of these parameters MUST always be present. When any of the defined 150 parameters are omitted, or if the Priority header field is not used, 151 their default values SHOULD be applied. 153 Unknown parameters MUST be ignored. 155 2.1. urgency 157 The "urgency" parameter takes one of the following sh-tokens as the 158 value that indicates how an HTTP response affects the usage of other 159 responses: 161 o "blocking" indicates that the response prevents other responses 162 from being used. 164 o "document" indicates that the response contains the document that 165 is being processed. 167 o "non-blocking" indicates that the response does not prevent the 168 client from using the document even though the response is being 169 used or referred to by the document. 171 The default value is "document". 173 A server SHOULD transmit HTTP responses in the order of their 174 urgency: "blocking" first, followed by "document", followed by "non- 175 blocking". 177 The following example shows a request for a CSS file with the urgency 178 set to "blocking": 180 :method = GET 181 :scheme = https 182 :authority = example.net 183 :path = /style.css 184 priority = urgency=blocking 186 2.2. progressive 188 The "progressive" parameter takes an sh-boolean as the value that 189 indicates if a response can be processed progressively, i.e. provide 190 some meaningful output as chunks of the response arrive. 192 The default value of the "progressive" parameter is "0". 194 A server SHOULD distribute the bandwidth of a connection between 195 progressive responses that share the same urgency. 197 A server SHOULD transmit non-progressive responses one by one, 198 preferably in the order the requests were generated. Doing so 199 maximizes the chance of the client making progress in using the 200 composition of the HTTP responses at the earliest moment. 202 The following example shows a request for a JPEG file with the 203 urgency parameter set to "non-blocking" and the progressive parameter 204 set to "1". 206 :method = GET 207 :scheme = https 208 :authority = example.net 209 :path = /image.jpg 210 priority = urgency=non-blocking, progressive=?1 212 3. Merging Client- and Server-Driven Parameters 214 It is not always the case that the client has the best view of how 215 the HTTP responses should be prioritized. For example, whether a 216 JPEG image should be served progressively by the server depends on 217 the structure of that image file - a property only known to the 218 server. 220 Therefore, a server is permitted to send a "Priority" response header 221 field. When used, the parameters found in this response header field 222 override those specified by the client. 224 For example, when the client sends an HTTP request with 226 :method = GET 227 :scheme = https 228 :authority = example.net 229 :path = /image.jpg 230 priority = urgency=non-blocking, progressive=?1 232 and the origin responds with 234 :status = 200 235 content-type = image/jpeg 236 priority = progressive=?0 238 the intermediary's view of the progressiveness of the response 239 becomes negative, because the server-provided value overrides that 240 provided by the client. The urgency is deemed as "non-blocking", 241 because the server did not specify the parameter. 243 4. Coexistence with HTTP/2 Priorities 245 Standard HTTP/2 ([RFC7540]) endpoints use frame-based prioritization, 246 whereby a client sends priority information in dedicated fields 247 present in HEADERS and PRIORITY frames. A client might instead 248 choose to use header-based prioritization as specified in this 249 document. 251 4.1. The SETTINGS_HEADER_BASED_PRIORITY SETTINGS Parameter 253 To improve communication of the client's intended prioritization 254 scheme, this document specifies a new HTTP/2 SETTINGS parameter with 255 the name "SETTINGS_HEADER_BASED_PRIORITY". The value of the 256 parameter MUST be 0 or 1; the initial value is 0. Frame-based 257 prioritization is respected when the value is 0, or when the server 258 does not recognize the setting. 260 An HTTP/2 client that uses header-based priority SHOULD send a 261 "SETTINGS_HEADER_BASED_PRIORITY" parameter with a value of 1 when 262 connecting to a server. 264 An intermediary SHOULD send a "SETTINGS_HEADER_BASED_PRIORITY" 265 parameter with a value of 1 for a connection it establishes when, and 266 only when, all the requests to be sent over that connection originate 267 from a client that utilizes this header-based prioritization scheme. 268 Otherwise this settings parameter SHOULD be set to 0. 270 A client or intermediary MUST NOT send a 271 "SETTINGS_HEADER_BASED_PRIORITY" parameter with the value of 0 after 272 previously sending a value of 1. 274 A server MUST NOT send a "SETTINGS_HEADER_BASED_PRIORITY" parameter. 275 Upon receipt, a client that supports header-based prioritization MUST 276 close the connection with a protocol error. Non-supporting clients 277 will ignore this extension element (see [RFC7540], Section 5.5). 279 5. Considerations 281 5.1. Why use an End-to-End Header Field? 283 Contrary to the prioritization scheme of HTTP/2 that uses a hop-by- 284 hop frame, the Priority header field is defined as end-to-end. 286 The rationale is that the Priority header field transmits how each 287 response affects the client's processing of those responses, rather 288 than how relatively urgent each response is to others. The way a 289 client processes a response is a property associated to that client 290 generating that request. Not that of an intermediary. Therefore, it 291 is an end-to-end property. How these end-to-end properties carried 292 by the Priority header field affect the prioritization between the 293 responses that share a connection is a hop-by-hop issue. 295 Having the Priority header field defined as end-to-end is important 296 for caching intermediaries. Such intermediaries can cache the value 297 of the Priority header field along with the response, and utilize the 298 value of the cached header field when serving the cached response, 299 only because the header field is defined as end-to-end rather than 300 hop-by-hop. 302 It should also be noted that the use of a header field carrying a 303 textual value makes the prioritization scheme extensible; see the 304 discussion below. 306 5.2. Why are there Only Three Levels of Urgency? 308 One of the aims of this specification is to define a mechanism for 309 merging client- and server-provided hints for prioritizing the 310 responses. For that to work, each urgency level needs to have a 311 well-defined meaning. As an example, a server can assign the highest 312 precedence among the non-blocking responses to an HTTP response 313 carrying an icon, because the meaning of "non-blocking" is shared 314 among the endpoints. 316 This specification restricts itself to defining just three levels of 317 urgency, in order to provide sufficient granularity for prioritizing 318 responses for ordinary web browsing, at minimal complexity. 320 However, that does not mean that the prioritization scheme would 321 forever be stuck to the three levels. The design provides 322 extensibility. If deemed necessary, it would be possible to divide 323 any of the three urgency levels into sub-levels by defining a new 324 parameter. As an example, a server could assign an "importance" 325 parameter to the priority of each image that it provides, so that an 326 intermediary could prioritize certain images above others. Or, a 327 graphical user-agent could send a "visible" parameter to indicate if 328 the resource being requested is within the viewport. 330 A server can combine the hints provided in the Priority header field 331 with other information in order to improve the prioritization of 332 responses. For example, a server that receives requests for a font 333 [RFC8081] and images with the same urgency might give higher 334 precedence to the font, so that a visual client can render textual 335 information at an early moment. 337 6. Security Considerations 339 TBD 341 7. IANA Considerations 343 This specification registers the following entry in the Permanent 344 Message Header Field Names registry established by [RFC3864]: 346 Header field name: Priority 348 Applicable protocol: http 350 Status: standard 352 Author/change controller: IETF 354 Specification document(s): This document 356 Related information: n/a 358 This specification registers the following entry in the HTTP/2 359 Settings registry established by [RFC7540]: 361 Name: SETTINGS_HEADER_BASED_PRIORITY: 363 Code: 0xTBD 365 Initial value: 0 367 Specification: This document 369 8. References 371 8.1. Normative References 373 [I-D.ietf-httpbis-header-structure] 374 Nottingham, M. and P. Kamp, "Structured Headers for HTTP", 375 draft-ietf-httpbis-header-structure-10 (work in progress), 376 April 2019. 378 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 379 Requirement Levels", BCP 14, RFC 2119, 380 DOI 10.17487/RFC2119, March 1997, . 383 [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 384 Protocol (HTTP/1.1): Message Syntax and Routing", 385 RFC 7230, DOI 10.17487/RFC7230, June 2014, 386 . 388 [RFC7540] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext 389 Transfer Protocol Version 2 (HTTP/2)", RFC 7540, 390 DOI 10.17487/RFC7540, May 2015, . 393 8.2. Informative References 395 [I-D.ietf-quic-http] 396 Bishop, M., "Hypertext Transfer Protocol Version 3 397 (HTTP/3)", draft-ietf-quic-http-20 (work in progress), 398 April 2019. 400 [RFC3864] Klyne, G., Nottingham, M., and J. Mogul, "Registration 401 Procedures for Message Header Fields", BCP 90, RFC 3864, 402 DOI 10.17487/RFC3864, September 2004, . 405 [RFC8081] Lilley, C., "The "font" Top-Level Media Type", RFC 8081, 406 DOI 10.17487/RFC8081, February 2017, . 409 Appendix A. Acknowledgements 411 Many thanks to Robin Marx, Patrick Meenan and Ian Swett for their 412 feedback. 414 Authors' Addresses 416 Kazuho Oku 417 Fastly 419 Email: kazuhooku@gmail.com 421 Lucas Pardue 422 Cloudflare 424 Email: lucaspardue.24.7@gmail.com