Movatterモバイル変換


[0]ホーム

URL:


RFC 9218HTTP PrioritiesJune 2022
Oku & PardueStandards Track[Page]
Stream:
Internet Engineering Task Force (IETF)
RFC:
9218
Category:
Standards Track
Published:
ISSN:
2070-1721
Authors:
奥 一穂 (K. Oku)
Fastly
L. Pardue
Cloudflare

RFC 9218

Extensible Prioritization Scheme for HTTP

Abstract

This document describes a scheme that allows an HTTP client to communicate itspreferences for how the upstream server prioritizes responses to its requests,and also allows a server to hint to a downstream intermediary how its responsesshould be prioritized when they are forwarded. This document defines thePriority header field for communicating the initial priority in an HTTPversion-independent manner, as well as HTTP/2 and HTTP/3 frames forreprioritizing responses. These share a common format structure that is designedto provide future extensibility.

Status of This Memo

This is an Internet Standards Track document.

This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 7841.

Information about the current status of this document, any errata, and how to provide feedback on it may be obtained athttps://www.rfc-editor.org/info/rfc9218.

Copyright Notice

Copyright (c) 2022 IETF Trust and the persons identified as the document authors. All rights reserved.

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.

Table of Contents

1.Introduction

It is common for representations of an HTTP[HTTP]resource to have relationships to one or more other resources. Clients willoften discover these relationships while processing a retrieved representation,which may lead to further retrieval requests. Meanwhile, the nature of therelationships determines whether a client is blocked from continuing to processlocally available resources. An example of this is the visual rendering of an HTMLdocument, which could be blocked by the retrieval of a Cascading Style Sheets (CSS) file that thedocument refers to. In contrast, inline images do not block rendering and get drawnincrementally as the chunks of the images arrive.

HTTP/2[HTTP/2] and HTTP/3[HTTP/3] support multiplexing of requests and responses ina single connection. An important feature of any implementation of a protocolthat provides multiplexing is the ability to prioritize the sending ofinformation. For example, to provide meaningful presentation of an HTML documentat the earliest moment, it is important for an HTTP server to prioritize theHTTP responses, or the chunks of those HTTP responses, that it sends to aclient.

HTTP/2 and HTTP/3 servers can schedule transmission of concurrent response databy any means they choose. Servers can ignore client priority signals and stillsuccessfully serve HTTP responses. However, servers that operate in ignoranceof how clients issue requests and consume responses can cause suboptimal clientapplication performance. Priority signals allow clients to communicate theirview of request priority. Servers have their own needs that are independent ofclient needs, so they often combine priority signals with other availableinformation in order to inform scheduling of response data.

RFC 7540[RFC7540] stream priority allowed a client to send a series ofpriority signals that communicate to the server a "priority tree"; the structureof this tree represents the client's preferred relative ordering and weighteddistribution of the bandwidth among HTTP responses. Servers could use thesepriority signals as input into prioritization decisions.

The design and implementation of RFC 7540 stream priority were observed to haveshortcomings, as explained inSection 2. HTTP/2[HTTP/2] has consequently deprecated the use ofthese stream priority signals. The prioritization scheme and priority signalsdefined herein can act as a substitute for RFC 7540 stream priority.

This document describes an extensible scheme for prioritizing HTTP responsesthat uses absolute values.Section 4 defines priority parameters, which area standardized and extensible format of priority information.Section 5defines the Priority HTTP header field, which is anend-to-end priority signal that is independent of protocol version. Clients can send this header field to signal theirview of how responses should be prioritized. Similarly, servers behind anintermediary can use it to signal priority to the intermediary. After sending arequest, a client can change their view of response priority (seeSection 6) by sending HTTP-version-specific frames as defined inSections 7.1 and7.2.

Header field and frame priority signals are input to a server's responseprioritization process. They are only a suggestion and do not guarantee anyparticular processing or transmission order for one response relative to anyother response. Sections 10 and12 provideconsiderations and guidance about how servers might act upon signals.

1.1.Notational Conventions

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14[RFC2119][RFC8174] when, and only when, they appear in all capitals, as shown here.

This document uses the following terminology fromSection 3 of [STRUCTURED-FIELDS] to specify syntax and parsing: "Boolean", "Dictionary", and "Integer".

Example HTTP requests and responses use the HTTP/2-style formatting from[HTTP/2].

This document uses the variable-length integer encoding from[QUIC].

The term "control stream" is used to describe both the HTTP/2 stream withidentifier 0x0 and the HTTP/3 control stream; seeSection 6.2.1 of [HTTP/3].

The term "HTTP/2 priority signal" is used to describe the priority informationsent from clients to servers in HTTP/2 frames; seeSection 5.3.2 of [HTTP/2].

2.Motivation for Replacing RFC 7540 Stream Priorities

RFC 7540 stream priority (seeSection 5.3 of [RFC7540]) is a complex systemwhere clients signal stream dependencies and weights to describe an unbalancedtree. It suffered from limited deployment and interoperability and has been deprecatedin a revision of HTTP/2[HTTP/2]. HTTP/2 retains these protocol elements inorder to maintain wire compatibility (seeSection 5.3.2 of [HTTP/2]), whichmeans that they might still be used even in the presence of alternative signaling,such as the scheme this document describes.

Many RFC 7540 server implementations do not act on HTTP/2 prioritysignals.

Prioritization can use information that servers have about resources orthe order in which requests are generated. For example, a server, with knowledgeof an HTML document structure, might want to prioritize the delivery of imagesthat are critical to user experience above other images. With RFC 7540, it isdifficult for servers to interpret signals from clients for prioritization, asthe same conditions could result in very different signaling from differentclients. This document describes signaling that is simpler and more constrained,requiring less interpretation and allowing less variation.

RFC 7540 does not define a method that can be used by a server to provide apriority signal for intermediaries.

RFC 7540 stream priority is expressed relative to other requests sharing the sameconnection at the same time. It is difficult to incorporate such a design intoapplications that generate requests without knowledge of how other requestsmight share a connection, or into protocols that do not have strong orderingguarantees across streams, like HTTP/3[HTTP/3].

Experiments from independent research[MARX] have shownthat simpler schemes can reach at least equivalent performance characteristicscompared to the more complex RFC 7540 setups seen in practice, at least for theWeb use case.

2.1.Disabling RFC 7540 Stream Priorities

The problems and insights set out above provided the motivation for analternative to RFC 7540 stream priority (seeSection 5.3 of [HTTP/2]).

The SETTINGS_NO_RFC7540_PRIORITIES HTTP/2 setting is defined by this document inorder to allow endpoints to omit or ignore HTTP/2 priority signals (seeSection 5.3.2 of [HTTP/2]), as described below. The value ofSETTINGS_NO_RFC7540_PRIORITIESMUST be 0 or 1. Any value other than 0 or 1MUSTbe treated as a connection error (seeSection 5.4.1 of [HTTP/2]) of typePROTOCOL_ERROR. The initial value is 0.

If endpoints use SETTINGS_NO_RFC7540_PRIORITIES, theyMUST send it in the firstSETTINGS frame. SendersMUST NOT change the SETTINGS_NO_RFC7540_PRIORITIES valueafter the first SETTINGS frame. Receivers that detect a changeMAY treat it as aconnection error of type PROTOCOL_ERROR.

Clients can send SETTINGS_NO_RFC7540_PRIORITIES with a value of 1 to indicatethat they are not using HTTP/2 priority signals. The SETTINGS frame precedes anyHTTP/2 priority signal sent from clients, so servers can determine whether theyneed to allocate any resources to signal handling before signals arrive. Aserver that receives SETTINGS_NO_RFC7540_PRIORITIES with a value of 1MUSTignore HTTP/2 priority signals.

Servers can send SETTINGS_NO_RFC7540_PRIORITIES with a value of 1 to indicatethat they will ignore HTTP/2 priority signals sent by clients.

Endpoints that send SETTINGS_NO_RFC7540_PRIORITIES are encouraged to usealternative priority signals (for example, seeSection 5 orSection 7.1), but there is no requirement to use a specific signal type.

2.1.1.Advice when Using Extensible Priorities as the Alternative

Before receiving a SETTINGS frame from a server, a client does not know if the serveris ignoring HTTP/2 priority signals. Therefore, until the client receives theSETTINGS frame from the server, the clientSHOULD send both the HTTP/2priority signals and the signals of this prioritization scheme (seeSections 5 and7.1).

Once the client receives the first SETTINGS frame that contains theSETTINGS_NO_RFC7540_PRIORITIES parameter with a value of 1, itSHOULD stop sendingthe HTTP/2 priority signals. This avoids sending redundant signals that areknown to be ignored.

Similarly, if the client receives SETTINGS_NO_RFC7540_PRIORITIES with a value of 0or if the settings parameter was absent, itSHOULD stop sending PRIORITY_UPDATEframes (Section 7.1), since those frames are likely to be ignored.However, the clientMAY continue sending the Priority header field(Section 5), as it is an end-to-end signal that might be useful to nodesbehind the server that the client is directly connected to.

3.Applicability of the Extensible Priority Scheme

The priority scheme defined by this document is primarily focused on theprioritization of HTTP response messages (seeSection 3.4 of [HTTP]). Itdefines new priority parameters (Section 4) and a means of conveying thoseparameters (Sections 5 and7), which is intended to communicatethe priority of responses to a server that is responsible for prioritizingthem.Section 10 provides considerations for servers about acting onthose signals in combination with other inputs and factors.

The CONNECT method (seeSection 9.3.6 of [HTTP]) can be used to establishtunnels. Signaling applies similarly to tunnels; additional considerations forserver prioritization are given inSection 11.

Section 9 describes how clients can optionally apply elements ofthis scheme locally to the request messages that they generate.

Some forms of HTTP extensions might change HTTP/2 or HTTP/3 stream behavior ordefine new data carriage mechanisms. Such extensions can themselves definehow this priority scheme is to be applied.

4.Priority Parameters

The priority information is a sequence of key-value pairs, providing room forfuture extensions. Each key-value pair represents a priority parameter.

The Priority HTTP header field (Section 5) is an end-to-end way totransmit this set of priority parameters when a request or a response is issued.After sending a request, a client can change their view of response priority(Section 6) by sending HTTP-version-specific PRIORITY_UPDATE frames asdefined in Sections 7.1 and7.2. Frames transmit priorityparameters on a single hop only.

Intermediaries can consume and produce priority signals in a PRIORITY_UPDATEframe or Priority header field. An intermediary that passes only the Priorityrequest header field to the next hop preserves the original end-to-end signalfrom the client; seeSection 14.An intermediary could pass the Priority header field and additionally send a PRIORITY_UPDATE frame. This would have the effect of preserving the original client end-to-end signal, while instructing the next hop to use a different priority, per the guidance inSection 7. An intermediary that replaces or adds a Priority request header field overrides the original client end-to-end signal, which can affect prioritization for all subsequent recipients of the request.

For both the Priority header field and the PRIORITY_UPDATE frame, the set ofpriority parameters is encoded as a Dictionary (seeSection 3.2 of [STRUCTURED-FIELDS]).

This document defines the urgency (u) and incremental (i) priority parameters.When receiving an HTTP request that does not carry these priority parameters, aserverSHOULD act as if their default values were specified.

An intermediary can combine signals from requests and responses that it forwards.Note that omission of priority parameters in responses is handled differently fromomission in requests; seeSection 8.

Receivers parse the Dictionary as described inSection 4.2 of [STRUCTURED-FIELDS]. Where the Dictionary is successfully parsed, this documentplaces the additional requirement that unknown priority parameters, priorityparameters with out-of-range values, or values of unexpected typesMUST beignored.

4.1.Urgency

The urgency (u) parameter value is Integer (seeSection 3.3.1 of [STRUCTURED-FIELDS]), between 0 and 7 inclusive, in descending order of priority. The default is 3.

Endpoints use this parameter to communicate their view of the precedence ofHTTP responses. The chosen value of urgency can be based on the expectation thatservers might use this information to transmit HTTP responses in the order oftheir urgency. The smaller the value, the higher the precedence.

The following example shows a request for a CSS file with the urgency set to0:

:method = GET:scheme = https:authority = example.net:path = /style.csspriority = u=0

A client that fetches a document that likely consists of multiple HTTP resources(e.g., HTML)SHOULD assign the default urgency level to the main resource. Thisconvention allows servers to refine the urgency usingknowledge specific to the website (seeSection 8).

The lowest urgency level (7) is reserved for background tasks such as deliveryof software updates. This urgency levelSHOULD NOT be used for fetchingresponses that have any impact on user interaction.

4.2.Incremental

The incremental (i) parameter value is Boolean (seeSection 3.3.6 of [STRUCTURED-FIELDS]). It indicatesif an HTTP response can be processed incrementally, i.e., provide somemeaningful output as chunks of the response arrive.

The default value of the incremental parameter isfalse (0).

If a client makes concurrent requests with the incremental parameter set tofalse, there is no benefit in serving responses with the same urgency concurrentlybecause the client is not going to process those responses incrementally.Serving non-incremental responses with the same urgency one by one, in the order in which thoserequests were generated, is considered to be the best strategy.

If a client makes concurrent requests with the incremental parameter set totrue, serving requests with the same urgency concurrently might be beneficial.Doing this distributes the connection bandwidth, meaning that responses takelonger to complete. Incremental delivery is most useful where multiplepartial responses might provide some value to clients ahead of acomplete response being available.

The following example shows a request for a JPEG file with the urgency parameterset to5 and the incremental parameter set totrue.

:method = GET:scheme = https:authority = example.net:path = /image.jpgpriority = u=5, i

4.3.Defining New Priority Parameters

When attempting to define new priority parameters, care must be taken so thatthey do not adversely interfere with prioritization performed by existingendpoints or intermediaries that do not understand the newly defined priorityparameters. Since unknown priority parameters are ignored, new priorityparameters should not change the interpretation of, or modify, the urgency (seeSection 4.1) or incremental (seeSection 4.2) priority parameters in a waythat is not backwards compatible or fallback safe.

For example, if there is a need to provide more granularity than eight urgencylevels, it would be possible to subdivide the range using an additional priorityparameter. Implementations that do not recognize the parameter can safelycontinue to use the less granular eight levels.

Alternatively, the urgency can be augmented. For example, a graphical user agentcould send avisible priority parameter to indicate if the resource being requested iswithin the viewport.

Generic priority parameters are preferred over vendor-specific,application-specific, or deployment-specific values. If a generic value cannot beagreed upon in the community, the parameter's name should be correspondinglyspecific (e.g., with a prefix that identifies the vendor, application, ordeployment).

4.3.1.Registration

New priority parameters can be defined by registering them in the "HTTP Priority"registry. This registry governs the keys (short textual strings) usedin the Dictionary (seeSection 3.2 of [STRUCTURED-FIELDS]).Since each HTTP request can have associated priority signals, there is valuein having short key lengths, especially single-character strings. In order toencourage extensions while avoiding unintended conflict among attractive keyvalues, the "HTTP Priority" registry operates two registration policies,depending on key length.

  • Registration requests for priority parameters with a key length of one use theSpecification Required policy, perSection 4.6 of [RFC8126].
  • Registration requests for priority parameters with a key length greater thanone use the Expert Review policy, perSection 4.5 of [RFC8126]. Aspecification document is appreciated but not required.

When reviewing registration requests, the designated expert(s) can consider theadditional guidance provided inSection 4.3 but cannot use it as a basisfor rejection.

Registration requests should use the following template:

Name:

[a name for the priority parameter that matches the parameter key]

Description:

[a description of the priority parameter semantics and value]

Reference:

[to a specification defining this priority parameter]

See the registry at<https://www.iana.org/assignments/http-priority> for details onwhere to send registration requests.

5.The Priority HTTP Header Field

The Priority HTTP header field is a Dictionary that carries priority parameters (seeSection 4).It can appear in requests and responses. It is an end-to-end signal thatindicates the endpoint's view of how HTTP responses should be prioritized.Section 8 describes how intermediaries can combine the priority informationsent from clients and servers. Clients cannot interpret the appearance oromission of a Priority response header field as acknowledgement that anyprioritization has occurred. Guidance for how endpoints can act on Priorityheader values is given in Sections 9 and10.

An HTTP request with a Priority header field might be cached and reused forsubsequent requests; see[CACHING]. When an originserver generates the Priority response header field based on properties of anHTTP request it receives, the server is expected to control the cacheability orthe applicability of the cached response by using header fields that controlthe caching behavior (e.g., Cache-Control, Vary).

6.Reprioritization

After a client sends a request, it may be beneficial to change the priority ofthe response. As an example, a web browser might issue a prefetch request for aJavaScript file with the urgency parameter of the Priority request header fieldset tou=7 (background). Then, when the user navigates to a page thatreferences the new JavaScript file, while the prefetch is in progress, thebrowser would send a reprioritization signal with the Priority Field Value settou=0. The PRIORITY_UPDATE frame (Section 7) can be used for suchreprioritization.

7.The PRIORITY_UPDATE Frame

This document specifies a new PRIORITY_UPDATE frame for HTTP/2[HTTP/2]and HTTP/3[HTTP/3]. It carries priority parameters andreferences the target of the prioritization based on a version-specificidentifier. In HTTP/2, this identifier is the stream ID; in HTTP/3, theidentifier is either the stream ID or push ID. Unlike the Priority header field,the PRIORITY_UPDATE frame is a hop-by-hop signal.

PRIORITY_UPDATE frames are sent by clients on the control stream, allowing themto be sent independently of the stream that carries the response. This meansthey can be used to reprioritize a response or a push stream, or to signal theinitial priority of a response instead of the Priority header field.

A PRIORITY_UPDATE frame communicates a complete set of all priority parametersin the Priority Field Value field. Omitting a priority parameter is a signal touse its default value. Failure to parse the Priority Field ValueMAY be treatedas a connection error. In HTTP/2, the error is of type PROTOCOL_ERROR; in HTTP/3,the error is of type H3_GENERAL_PROTOCOL_ERROR.

A clientMAY send a PRIORITY_UPDATE frame before the stream that it referencesis open (except for HTTP/2 push streams; seeSection 7.1). Furthermore,HTTP/3 offers no guaranteed ordering across streams, which could cause the frameto be received earlier than intended. Either case leads to a race conditionwhere a server receives a PRIORITY_UPDATE frame that references a request streamthat is yet to be opened. To solve this condition, for the purposes ofscheduling, the most recently received PRIORITY_UPDATE frame can be consideredas the most up-to-date information that overrides any other signal. ServersSHOULD buffer the most recently received PRIORITY_UPDATE frame and apply it oncethe referenced stream is opened. Holding PRIORITY_UPDATE frames for each streamrequires server resources, which can be bounded by local implementation policy.Although there is no limit to the number of PRIORITY_UPDATE frames that can besent, storing only the most recently received frame limits resource commitment.

7.1.HTTP/2 PRIORITY_UPDATE Frame

The HTTP/2 PRIORITY_UPDATE frame (type=0x10) is used by clients to signal theinitial priority of a response, or to reprioritize a response or push stream. Itcarries the stream ID of the response and the priority in ASCII text, using thesame representation as the Priority header field value.

The Stream Identifier field (seeSection 5.1.1 of [HTTP/2]) in thePRIORITY_UPDATE frame headerMUST be zero (0x0). Receiving a PRIORITY_UPDATEframe with a field of any other valueMUST be treated as a connection error oftype PROTOCOL_ERROR.

HTTP/2 PRIORITY_UPDATE Frame {  Length (24),  Type (8) = 0x10,  Unused Flags (8),  Reserved (1),  Stream Identifier (31),  Reserved (1),  Prioritized Stream ID (31),  Priority Field Value (..),}
Figure 1:HTTP/2 PRIORITY_UPDATE Frame Format

The Length, Type, Unused Flag(s), Reserved, and Stream Identifier fields aredescribed inSection 4 of [HTTP/2]. The PRIORITY_UPDATE frame payloadcontains the following additional fields:

Prioritized Stream ID:

A 31-bit stream identifier for the stream that is the target of the priorityupdate.

Priority Field Value:

The priority update value in ASCII text, encoded using Structured Fields. Thisis the same representation as the Priority header field value.

When the PRIORITY_UPDATE frame applies to a request stream, clientsSHOULDprovide a prioritized stream ID that refers to a stream in the "open","half-closed (local)", or "idle" state (i.e., streams where data might still be received). Servers can discard frames where theprioritized stream ID refers to a stream in the "half-closed (local)" or"closed" state (i.e., streams where no further data will be sent). The number of streams that have been prioritized but remain inthe "idle" state plus the number of active streams (those in the "open" state orin either of the "half-closed" states; seeSection 5.1.2 of [HTTP/2])MUST NOT exceedthe value of the SETTINGS_MAX_CONCURRENT_STREAMS parameter. Servers that receivesuch a PRIORITY_UPDATEMUST respond with a connection error of typePROTOCOL_ERROR.

When the PRIORITY_UPDATE frame applies to a push stream, clientsSHOULD providea prioritized stream ID that refers to a stream in the "reserved (remote)" or"half-closed (local)" state. Servers can discard frames where the prioritizedstream ID refers to a stream in the "closed" state. ClientsMUST NOT provide aprioritized stream ID that refers to a push stream in the "idle" state. Serversthat receive a PRIORITY_UPDATE for a push stream in the "idle" stateMUSTrespond with a connection error of type PROTOCOL_ERROR.

If a PRIORITY_UPDATE frame is received with a prioritized stream ID of 0x0, therecipientMUST respond with a connection error of type PROTOCOL_ERROR.

ServersMUST NOT send PRIORITY_UPDATE frames. If a client receives aPRIORITY_UPDATE frame, itMUST respond with a connection error of typePROTOCOL_ERROR.

7.2.HTTP/3 PRIORITY_UPDATE Frame

The HTTP/3 PRIORITY_UPDATE frame (type=0xF0700 or 0xF0701) is used by clients tosignal the initial priority of a response, or to reprioritize a response or pushstream. It carries the identifier of the element that is being prioritized andthe updated priority in ASCII text that uses the same representation as that ofthe Priority header field value. PRIORITY_UPDATE with a frame type of 0xF0700 isused for request streams, while PRIORITY_UPDATE with a frame type of 0xF0701 isused for push streams.

The PRIORITY_UPDATE frameMUST be sent on the client control stream(seeSection 6.2.1 of [HTTP/3]). Receiving a PRIORITY_UPDATE frame on astream other than the client control streamMUST be treated as a connectionerror of type H3_FRAME_UNEXPECTED.

HTTP/3 PRIORITY_UPDATE Frame {  Type (i) = 0xF0700..0xF0701,  Length (i),  Prioritized Element ID (i),  Priority Field Value (..),}
Figure 2:HTTP/3 PRIORITY_UPDATE Frame

The PRIORITY_UPDATE frame payload has the following fields:

Prioritized Element ID:

The stream ID or push ID that is the target of the priority update.

Priority Field Value:

The priority update value in ASCII text, encoded using Structured Fields. Thisis the same representation as the Priority header field value.

The request-stream variant of PRIORITY_UPDATE (type=0xF0700)MUST reference arequest stream. If a server receives a PRIORITY_UPDATE (type=0xF0700) for astream ID that is not a request stream, thisMUST be treated as a connectionerror of type H3_ID_ERROR. The stream IDMUST be within the client-initiatedbidirectional stream limit. If a server receives a PRIORITY_UPDATE(type=0xF0700) with a stream ID that is beyond the stream limits, thisSHOULD betreated as a connection error of type H3_ID_ERROR. Generating an error is notmandatory because HTTP/3 implementations might have practical barriers todetermining the active stream concurrency limit that is applied by the QUIClayer.

The push-stream variant of PRIORITY_UPDATE (type=0xF0701)MUST reference a promisedpush stream. If a server receives a PRIORITY_UPDATE (type=0xF0701) with a push IDthat is greater than the maximum push ID or that has not yet been promised, thisMUST be treated as a connection error of type H3_ID_ERROR.

ServersMUST NOT send PRIORITY_UPDATE frames of either type. If a clientreceives a PRIORITY_UPDATE frame, thisMUST be treated as a connection error oftype H3_FRAME_UNEXPECTED.

8.Merging Client- and Server-Driven Priority Parameters

It is not always the case that the client has the best understanding of how theHTTP responses deserve to be prioritized. The server might have additionalinformation that can be combined with the client's indicated priority in orderto improve the prioritization of the response. For example, use of an HTMLdocument might depend heavily on one of the inline images; the existence of suchdependencies is typically best known to the server. Or, a server that receivesrequests for a font[RFC8081] and images with the same urgency might givehigher precedence to the font, so that a visual client can render textualinformation at an early moment.

An origin can use the Priority response header field to indicate its view on howan HTTP response should be prioritized. An intermediary that forwards an HTTPresponse can use the priority parameters found in the Priority response headerfield, in combination with the client Priority request header field, as input toits prioritization process. No guidance is provided for merging priorities; thisis left as an implementation decision.

The absence of a priority parameter in an HTTP response indicates the server'sdisinterest in changing the client-provided value. This is different from therequest header field, in which omission of a priority parameter implies the use of its default value (seeSection 4).

As a non-normative example, when the client sends an HTTP request with theurgency parameter set to5 and the incremental parameter set totrue

:method = GET:scheme = https:authority = example.net:path = /menu.pngpriority = u=5, i

and the origin responds with

:status = 200content-type = image/pngpriority = u=1

the intermediary might alter its understanding of the urgency from5 to1,because it prefers the server-provided value over the client's. The incrementalvalue continues to betrue, i.e., the value specified by the client, as the server didnot specify the incremental (i) parameter.

9.Client Scheduling

A clientMAY use priority values to make local processing or scheduling choicesabout the requests it initiates.

10.Server Scheduling

It is generally beneficial for an HTTP server to send all responses as early aspossible. However, when serving multiple requests on a single connection, therecould be competition between the requests for resources such as connectionbandwidth. This section describes considerations regarding how servers canschedule the order in which the competing responses will be sent when suchcompetition exists.

Server scheduling is a prioritization process based on many inputs, withpriority signals being only one form of input. Factors such as implementationchoices or deployment environment also play a role. Any given connection islikely to have many dynamic permutations. For these reasons, it is not possibleto describe a universal scheduling algorithm. This document provides some basic,non-exhaustive recommendations for how servers might act on priorityparameters. It does not describe in detail how servers might combine prioritysignals with other factors. Endpoints cannot depend on particular treatmentbased on priority signals. Expressing priority is only a suggestion.

It isRECOMMENDED that, when possible, servers respect the urgency parameter(Section 4.1), sending higher-urgency responses before lower-urgency responses.

The incremental parameter indicates how a client processes response bytes asthey arrive. It isRECOMMENDED that, when possible, servers respect theincremental parameter (Section 4.2).

Non-incremental responses of the same urgencySHOULD be served by prioritizingbandwidth allocation in ascending order of the stream ID, which corresponds tothe order in which clients make requests. Doing so ensures that clients can userequest ordering to influence response order.

Incremental responses of the same urgencySHOULD be served by sharing bandwidthamong them. The message content of incremental responses is used as parts, or chunks,are received. A client might benefit more from receiving a portion of allthese resources rather than the entirety of a single resource. How large aportion of the resource is needed to be useful in improving performance varies.Some resource types place critical elements early; others can use informationprogressively. This scheme provides no explicit mandate about how a servershould use size, type, or any other input to decide how to prioritize.

There can be scenarios where a server will need to schedule multiple incrementaland non-incremental responses at the same urgency level. Strictly abiding by thescheduling guidance based on urgency and request generation order might leadto suboptimal results at the client, as early non-incremental responses mightprevent the serving of incremental responses issued later. The following areexamples of such challenges:

  1. At the same urgency level, a non-incremental request for a large resourcefollowed by an incremental request for a small resource.
  2. At the same urgency level, an incremental request of indeterminate lengthfollowed by a non-incremental large resource.

It isRECOMMENDED that servers avoid such starvation where possible. The methodfor doing so is an implementation decision. For example, a server mightpreemptively send responses of a particular incremental type based on otherinformation such as content size.

Optimal scheduling of server push is difficult, especially when pushed resourcescontend with active concurrent requests. Servers can consider many factors whenscheduling, such as the type or size of resource being pushed, the priority ofthe request that triggered the push, the count of active concurrent responses,the priority of other active concurrent responses, etc. There is no generalguidance on the best way to apply these. A server that is too simple couldeasily push at too high a priority and block client requests, or push at too lowa priority and delay the response, negating intended goals of server push.

Priority signals are a factor for server push scheduling. The concept ofparameter value defaults applies slightly differently because there is noexplicit client-signaled initial priority. A server can apply priority signalsprovided in an origin response; see the merging guidance given inSection 8.In the absence of origin signals, applying default parameter values could besuboptimal. By whatever means a server decides to schedule a pushed response, itcan signal the intended priority to the client by including the Priority fieldin a PUSH_PROMISE or HEADERS frame.

10.1.Intermediaries with Multiple Backend Connections

An intermediary serving an HTTP connection might split requests over multiplebackend connections. When it applies prioritization rules strictly, low-priorityrequests cannot make progress while requests with higher priorities are inflight. This blocking can propagate to backend connections, which the peer mightinterpret as a connection stall. Endpoints often implement protections againststalls, such as abruptly closing connections after a certain time period. Toreduce the possibility of this occurring, intermediaries can avoid strictlyfollowing prioritization and instead allocate small amounts of bandwidth for allthe requests that they are forwarding, so that every request can make someprogress over time.

Similarly, serversSHOULD allocate some amount of bandwidths to streams actingas tunnels.

11.Scheduling and the CONNECT Method

When a stream carries a CONNECT request, the scheduling guidance inthis document applies to the frames on the stream. A client that issues multipleCONNECT requests can set the incremental parameter totrue. Servers thatimplement the recommendations for handling of the incremental parameter (Section 10) are likely to schedule these fairly, preventing oneCONNECT stream from blocking others.

12.Retransmission Scheduling

Transport protocols such as TCP and QUIC provide reliability by detecting packetlosses and retransmitting lost information. In addition to the considerations inSection 10, scheduling of retransmission data could compete with newdata. The remainder of this section discusses considerations when using QUIC.

Section 13.3 of [QUIC] states the following: "EndpointsSHOULD prioritizeretransmission of data over sending new data, unless priorities specified by theapplication indicate otherwise". When an HTTP/3 application uses the priorityscheme defined in this document and the QUIC transport implementation supportsapplication-indicated stream priority, a transport that considers the relativepriority of streams when scheduling both new data and retransmission data mightbetter match the expectations of the application. However, there are norequirements on how a transport chooses to schedule based on this informationbecause the decision depends on several factors and trade-offs. It couldprioritize new data for a higher-urgency stream over retransmission data for alower-priority stream, or it could prioritize retransmission data over new datairrespective of urgencies.

Section 6.2.4 of [QUIC-RECOVERY] also highlights considerations regardingapplication priorities when sending probe packets after Probe Timeout timerexpiration. A QUIC implementation supporting application-indicated prioritiesmight use the relative priority of streams when choosing probe data.

13.Fairness

Typically, HTTP implementations depend on the underlying transport to maintainfairness between connections competing for bandwidth. When an intermediary receives HTTP requests on client connections, it forwards them to backend connections. Depending on how the intermediary coalesces or splits requests across different backend connections, different clients might experience dissimilar performance. This dissimilarity might expand if the intermediary also uses priority signals whenforwarding requests. Sections 13.1 and13.2 discussmitigations of this expansion of unfairness.

Conversely,Section 13.3 discusses how servers might intentionallyallocate unequal bandwidth to some connections, depending on the prioritysignals.

13.1.Coalescing Intermediaries

When an intermediary coalesces HTTP requests coming from multiple clients intoone HTTP/2 or HTTP/3 connection going to the backend server, requests thatoriginate from one client might carry signals indicating higher priority thanthose coming from others.

It is sometimes beneficial for the server running behind an intermediary to obeyPriority header field values. As an example, a resource-constrainedserver might defer the transmission of software update files that have thebackground urgency level (7). However, in the worst case, the asymmetrybetween the priority declared by multiple clients might cause all responses going toone user agent to be delayed until all responses going to another user agent have been sent.

In order to mitigate this fairness problem, a server could use knowledge aboutthe intermediary as another input in its prioritization decisions. Forinstance, if a server knows the intermediary is coalescing requests, then itcould avoid serving the responses in their entirety and instead distributebandwidth (for example, in a round-robin manner). This can work if theconstrained resource is network capacity between the intermediary and the useragent, as the intermediary buffers responses and forwards the chunks based onthe prioritization scheme it implements.

A server can determine if a request came from an intermediary throughconfiguration or can check to see if the request contains one of the followingheader fields:

13.2.HTTP/1.x Back Ends

It is common for Content Delivery Network (CDN) infrastructure to support different HTTP versions on thefront end and back end. For instance, the client-facing edge might supportHTTP/2 and HTTP/3 while communication to backend servers is done usingHTTP/1.1. Unlike connection coalescing, the CDN will "demux" requests intodiscrete connections to the back end. Response multiplexing in a single connection is not supported by HTTP/1.1 (or older), so there is not a fairness problem.However, backend serversMAY still use client headers for request scheduling.Backend serversSHOULD only schedule based on client priority information wherethat information can be scoped to individual end clients. Authentication andother session information might provide this linkability.

13.3.Intentional Introduction of Unfairness

It is sometimes beneficial to deprioritize the transmission of one connectionover others, knowing that doing so introduces a certain amount of unfairnessbetween the connections and therefore between the requests served on thoseconnections.

For example, a server might use a scavenging congestion controller onconnections that only convey background priority responses such as softwareupdate images. Doing so improves responsiveness of other connections at the costof delaying the delivery of updates.

14.Why Use an End-to-End Header Field?

In contrast to the prioritization scheme of HTTP/2, which uses a hop-by-hop frame,the Priority header field is defined as "end-to-end".

The way that a client processes a response is a property associated with theclient generating that request, not that of an intermediary. Therefore, it isan end-to-end property. How these end-to-end properties carried by the Priorityheader field affect the prioritization between the responses that share aconnection is a hop-by-hop issue.

Having the Priority header field defined as end-to-end is important for cachingintermediaries. Such intermediaries can cache the value of the Priority headerfield along with the response and utilize the value of the cached header fieldwhen serving the cached response, only because the header field is defined asend-to-end rather than hop-by-hop.

15.Security Considerations

Section 7 describes considerations for server buffering of PRIORITY_UPDATEframes.

Section 10 presents examples where servers that prioritize responsesin a certain way might be starved of the ability to transmit responses.

The security considerations from[STRUCTURED-FIELDS] apply to the processing ofpriority parameters defined inSection 4.

16.IANA Considerations

This specification registers the following entry in the "Hypertext TransferProtocol (HTTP) Field Name Registry" defined in[HTTP/2]:

Field Name:

Priority

Status:

permanent

Reference:

This document

This specification registers the following entry in the "HTTP/2 Settings" registrydefined in[HTTP/2]:

Code:

0x9

Name:

SETTINGS_NO_RFC7540_PRIORITIES

Initial Value:

0

Reference:

This document

This specification registers the following entry in the "HTTP/2 Frame Type"registry defined in[HTTP/2]:

Code:

0x10

Frame Type:

PRIORITY_UPDATE

Reference:

This document

This specification registers the following entry in the "HTTP/3 Frame Types"registry established by[HTTP/3]:

Value:

0xF0700-0xF0701

Frame Type:

PRIORITY_UPDATE

Status:

permanent

Reference:

This document

Change Controller:

IETF

Contact:

ietf-http-wg@w3.org

IANA has created the "Hypertext Transfer Protocol (HTTP) Priority" registry at<https://www.iana.org/assignments/http-priority> and has populated it with the entries inTable 1; seeSection 4.3.1 for its associated procedures.

Table 1:Initial Priority Parameters
NameDescriptionReference
uThe urgency of an HTTP response.Section 4.1
iWhether an HTTP response can be processed incrementally.Section 4.2

17.References

17.1.Normative References

[HTTP]
Fielding, R., Ed.,Nottingham, M., Ed., andJ. Reschke, Ed.,"HTTP Semantics",STD 97,RFC 9110,DOI 10.17487/RFC9110,,<https://www.rfc-editor.org/info/rfc9110>.
[HTTP/2]
Thomson, M., Ed. andC. Benfield, Ed.,"HTTP/2",RFC 9113,DOI 10.17487/RFC9113,,<https://www.rfc-editor.org/info/rfc9113>.
[HTTP/3]
Bishop, M., Ed.,"HTTP/3",RFC 9114,DOI 10.17487/RFC9114,,<https://www.rfc-editor.org/info/rfc9114>.
[QUIC]
Iyengar, J., Ed. andM. Thomson, Ed.,"QUIC: A UDP-Based Multiplexed and Secure Transport",RFC 9000,DOI 10.17487/RFC9000,,<https://www.rfc-editor.org/info/rfc9000>.
[RFC2119]
Bradner, S.,"Key words for use in RFCs to Indicate Requirement Levels",BCP 14,RFC 2119,DOI 10.17487/RFC2119,,<https://www.rfc-editor.org/info/rfc2119>.
[RFC8126]
Cotton, M.,Leiba, B., andT. Narten,"Guidelines for Writing an IANA Considerations Section in RFCs",BCP 26,RFC 8126,DOI 10.17487/RFC8126,,<https://www.rfc-editor.org/info/rfc8126>.
[RFC8174]
Leiba, B.,"Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words",BCP 14,RFC 8174,DOI 10.17487/RFC8174,,<https://www.rfc-editor.org/info/rfc8174>.
[STRUCTURED-FIELDS]
Nottingham, M. andP-H. Kamp,"Structured Field Values for HTTP",RFC 8941,DOI 10.17487/RFC8941,,<https://www.rfc-editor.org/info/rfc8941>.

17.2.Informative References

[CACHING]
Fielding, R., Ed.,Nottingham, M., Ed., andJ. Reschke, Ed.,"HTTP Caching",STD 98,RFC 9111,DOI 10.17487/RFC9111,,<https://www.rfc-editor.org/info/rfc9111>.
[FORWARDED]
Petersson, A. andM. Nilsson,"Forwarded HTTP Extension",RFC 7239,DOI 10.17487/RFC7239,,<https://www.rfc-editor.org/info/rfc7239>.
[MARX]
Marx, R.,De Decker, T.,Quax, P., andW. Lamotte,"Of the Utmost Importance: Resource Prioritization in HTTP/3 over QUIC",SCITEPRESS Proceedings of the 15th International Conference on Web Information Systems and Technologies (pages 130-143),DOI 10.5220/0008191701300143,,<https://www.doi.org/10.5220/0008191701300143>.
[PRIORITY-SETTING]
Lassey, B. andL. Pardue,"Declaring Support for HTTP/2 Priorities",Work in Progress,Internet-Draft, draft-lassey-priority-setting-00,,<https://datatracker.ietf.org/doc/html/draft-lassey-priority-setting-00>.
[QUIC-RECOVERY]
Iyengar, J., Ed. andI. Swett, Ed.,"QUIC Loss Detection and Congestion Control",RFC 9002,DOI 10.17487/RFC9002,,<https://www.rfc-editor.org/info/rfc9002>.
[RFC7540]
Belshe, M.,Peon, R., andM. Thomson, Ed.,"Hypertext Transfer Protocol Version 2 (HTTP/2)",RFC 7540,DOI 10.17487/RFC7540,,<https://www.rfc-editor.org/info/rfc7540>.
[RFC8081]
Lilley, C.,"The "font" Top-Level Media Type",RFC 8081,DOI 10.17487/RFC8081,,<https://www.rfc-editor.org/info/rfc8081>.

Acknowledgements

Roy Fieldingpresented the idea of using a header field for representingpriorities in<https://www.ietf.org/proceedings/83/slides/slides-83-httpbis-5.pdf>.In<https://github.com/pmeenan/http3-prioritization-proposal>,Patrick Meenanadvocated for representing the priorities using a tuple of urgency andconcurrency. The ability to disable HTTP/2 prioritization is inspired by[PRIORITY-SETTING], authored byBrad Lassey andLucas Pardue, withmodifications based on feedback that was not incorporated into an update to thatdocument.

The motivation for defining an alternative to HTTP/2 priorities is drawn fromdiscussion within the broad HTTP community. Special thanks toRoberto Peon,Martin Thomson, and Netflix for text that was incorporated explicitly in thisdocument.

In addition to the people above, this document owes a lot to the extensivediscussion in the HTTP priority design team, consisting ofAlan Frindell,Andrew Galloni,Craig Taylor,Ian Swett,Matthew Cox,Mike Bishop,Roberto Peon,Robin Marx,Roy Fielding, and the authors of this document.

Yang Chi contributed the section on retransmission scheduling.

Authors' Addresses

Kazuho Oku
Fastly
Email:kazuhooku@gmail.com
Additional contact information:
奥 一穂
Fastly
Lucas Pardue
Cloudflare
Email:lucaspardue.24.7@gmail.com

[8]ページ先頭

©2009-2025 Movatter.jp