<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>

<!-- generated by https://github.com/cabo/kramdown-rfc version 1.7.39 (Ruby 2.5.9) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-ietf-httpbis-incremental-04" category="std" consensus="true" submissionType="IETF" xml:lang="en" number="10036" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.34.0 -->
  <link href="https://datatracker.ietf.org/doc/draft-ietf-httpbis-incremental-04" rel="prev"/>
  <front>
    <title>Incremental Forwarding of HTTP Messages</title>
    <seriesInfo name="RFC" value="10036"/>
    <author fullname="奥 一穂" asciiFullname="Kazuho Oku" initials="K." surname="Oku">
      <organization>Fastly</organization>
      <address>
        <email>kazuhooku@gmail.com</email>
      </address>
    </author>
    <author fullname="Tommy Pauly" initials="T." surname="Pauly">
      <organization>Apple</organization>
      <address>
        <email>tpauly@apple.com</email>
      </address>
    </author>
    <author fullname="Martin Thomson" initials="M." surname="Thomson">
      <organization>Mozilla</organization>
      <address>
        <email>mt@lowentropy.net</email>
      </address>
    </author>
    <date year="2026" month="August"/>
    <area>WIT</area>
    <workgroup>httpbis</workgroup>
    <keyword>stream</keyword>
    <abstract>

<t>This document specifies the "Incremental" HTTP header field, which instructs
HTTP intermediaries to forward the HTTP message incrementally.</t>
    </abstract>
  </front>
  <middle>

<section anchor="introduction">
      <name>Introduction</name>
      <t>HTTP <xref target="RFC9110"/> permits receivers to begin processing portions of HTTP
messages as they arrive, rather than requiring them to wait for the entire HTTP
message to be received before acting.</t>
      <t>Some applications are specifically designed to take advantage of this
capability.</t>
      <t>For example, Server-Sent Events <xref target="SSE"/> uses a long-running HTTP response, where
the server continually sends notifications as they become available.</t>
      <t>In the case of Chunked Oblivious HTTP Messages
<xref target="I-D.ietf-ohai-chunked-ohttp"/>, the client opens an HTTP request
and incrementally sends application data, while the server can start responding
even before the HTTP request is fully complete. In this way, the HTTP
request-response pair could create what is, in effect, a bidirectional
communication channel.</t>
      <t>Applications that rely on incremental delivery of data are fragile when HTTP intermediaries are involved.
This is because HTTP intermediaries are not only permitted but are frequently
deployed to buffer complete HTTP messages before forwarding them downstream
(<xref section="7.6" sectionFormat="of" target="RFC9110"/>).</t>
      <t>If such a buffering HTTP intermediary exists between the client and the server,
these applications may fail to function as intended.</t>
      <t>In the case of Server-Sent Events, an intermediary that tries to buffer the HTTP
response completely before forwarding it could be left waiting indefinitely.
A client might never receive any portion of the response.</t>
      <t>In the case of requests that involve any bidirectional exchange,
an intermediary that tries to buffer entire messages --
either request or response -- prevents any data from being delivered.</t>
      <t>To help avoid such behavior, this document specifies the "Incremental" HTTP header
field, which requests that HTTP intermediaries begin forwarding the HTTP message
downstream before receiving the complete message.</t>
      <t>This indication might not be supported by intermediaries.
Intermediaries that are unaware of this field will not change their behavior.
Intermediaries that support the field might choose instead to reject a request;
see <xref target="security"/>.</t>
    </section>
    <section anchor="conventions-and-definitions">
      <name>Conventions and Definitions</name>
      <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
"<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they
appear in all capitals, as shown here.</t>

<t>This document relies on structured field definitions
of Item and Boolean <xref target="RFC9651"/>.</t>
    </section>
    <section anchor="the-incremental-header-field">
      <name>The Incremental Header Field</name>
      <t>The Incremental HTTP header field expresses the sender's intent for HTTP
intermediaries to start forwarding the message downstream before the entire
message is received.</t>
      <t>The Incremental header field is defined as a structured field
<xref target="RFC9651"/> of type Item.
Only Boolean values (<xref section="3.3.6" sectionFormat="of" target="RFC9651"/>) are valid;
a recipient ignores the field if it contains any other type.</t>
      <sourcecode type="http-message"><![CDATA[
Incremental: ?1
]]></sourcecode>
      <t>A true value ("?1") indicates that the sender requests intermediaries to forward
the message incrementally, as described below.</t>
      <sourcecode type="http-message"><![CDATA[
Incremental: ?0
]]></sourcecode>
      <t>A false value ("?0") indicates the default behavior defined in <xref target="RFC9110"/>, where
intermediaries might buffer the entire message before forwarding it. However,
this explicit signal might give an intermediary greater confidence in
choosing to buffer.</t>
      <t>The Incremental HTTP header field applies to each HTTP message. Therefore, if
both the HTTP request and response need to be forwarded incrementally, the
Incremental HTTP header field <bcp14>MUST</bcp14> be set for both the HTTP request and the
response.</t>
      <t>Upon receiving a header section that includes an Incremental header field with a
true value, HTTP intermediaries <bcp14>SHOULD NOT</bcp14> buffer the entire message before
forwarding it.  Instead, intermediaries <bcp14>SHOULD</bcp14> transmit the header section
downstream and continuously forward the bytes of the message content as they
arrive. As the Incremental header field indicates only how the message content is
to be forwarded, intermediaries can still buffer the entire header and trailer
sections of the message before forwarding them downstream.</t>
      <t>If an intermediary decides outright to refuse forwarding the message body
incrementally, the intermediary <bcp14>MUST</bcp14> generate an error response rather than
buffering an entire message before forwarding. Typical scenarios under which an
intermediary might refuse are discussed in <xref target="security"/>.</t>
      <t>The request to use incremental forwarding also applies to HTTP implementations.
Though most HTTP APIs provide the ability to incrementally transfer message content,
those that do not for any reason <bcp14>SHOULD</bcp14> use the presence of the Incremental
header field to reduce or disable buffering.</t>
      <t>The Incremental field might not be supported by intermediaries.
Intermediaries that are unaware of the field
or that do not support the field might buffer messages,
even when explicitly requested otherwise.
Clients and servers therefore cannot expect all intermediaries to understand
and respect a request to deliver messages incrementally.
Clients that depend on support for incremental forwarding can rely on prior knowledge
or probe for support on individual resources.</t>
      <t>The Incremental header field facilitates the establishment of a bidirectional
byte channel over HTTP, as its presence in both requests and responses requests that
intermediaries forward early responses (<xref section="7.5" sectionFormat="of" target="RFC9110"/>) and 
transmit message contents incrementally in both directions.  However, when developing
bidirectional protocols over HTTP, Extended CONNECT <xref target="RFC8441"/><xref target="RFC9220"/> is
generally more consistent with HTTP's architecture.</t>
      <t>This document does not define any parameters for the Incremental header field
value, but future documents might define parameters. Receivers <bcp14>MUST</bcp14> ignore
unknown parameters.</t>
    </section>
    <section anchor="security">
      <name>Security Considerations</name>
      <t>When receiving a request or response that asks for incremental forwarding,
intermediaries might reject the HTTP request due to security concerns.
The following subsections explore typical scenarios
under which the intermediaries might reject requests.</t>
      <t>Note that rejecting requests based on the value of the Incremental field
only occurs when an intermediary understands the field.</t>
      <section anchor="permanent-rejection">
        <name>Permanent Rejection</name>
        <t>Some intermediaries inspect the content of HTTP messages and forward them only
if their content is deemed safe. Any feature that depends on seeing the
entirety of the message in this way is incompatible with incremental delivery.</t>
        <t>When an intermediary is asked to incrementally forward a message and cannot --
whether that message is a request or a response --
due to security concerns about the message content,
the intermediary <bcp14>SHOULD</bcp14> respond with a 501 (Not Implemented) error
with an incremental_refused Proxy-Status response header field
(<xref target="iana-considerations"/>).</t>
      </section>
      <section anchor="temporary-rejection">
        <name>Temporary Rejection</name>
        <t>To conserve resources required to handle HTTP requests or connections, it is
common for intermediaries to impose limits on the maximum number of concurrent
HTTP requests that they forward, while buffering requests that exceed this
limit.</t>
        <t>Such intermediaries could apply a more restrictive concurrency limit to requests
marked as incremental to ensure that capacity remains available for
non-incremental requests, even when the maximum number of incremental requests
is reached. This approach helps balance the processing of different types of
requests and maintains service availability across all requests.</t>
        <t>When rejecting incremental requests due to reaching the concurrency limit,
intermediaries <bcp14>SHOULD</bcp14> respond with a 429 (Too Many Requests) error
(<xref section="4" sectionFormat="of" target="RFC6585"/>),
accompanied by a connection_limit_reached Proxy-Status response header field
(<xref section="2.3.12" sectionFormat="of" target="RFC9209"/>).</t>
      </section>
      <section anchor="handling-of-small-packets">
        <name>Handling of Small Packets</name>
        <t>For performance and efficiency reasons, a small amount of buffering might be
used by intermediaries, even for incremental messages. Immediate forwarding
might be exploited to cause an intermediary to waste effort on many small
packets.  Enabling incremental delivery might instead set limits on the number of
bytes that are buffered or the length of time that buffers are held before forwarding.
Any buffering could adversely affect application latency, even if it improves
efficiency.  In all cases, intermediaries cannot hold data in buffers
indefinitely, so data needs to be forwarded when either the time limit or the
byte limit is reached.</t>
      </section>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>An HTTP field named Incremental has been registered
in the "Hypertext Transfer Protocol (HTTP) Field Name Registry"
following the procedures in <xref section="18.4" sectionFormat="of" target="RFC9110"/>.
The following values are registered:</t>
      <dl spacing="compact">
        <dt>Field Name:</dt>
        <dd>
          <t>Incremental</t>
        </dd>
        <dt>Status:</dt>
        <dd>
          <t>permanent</t>
        </dd>
        <dt>Structured Type:</dt>
        <dd>
          <t>Item</t>
        </dd>
        <dt>Reference:</dt>
        <dd>
          <t>This document</t>
        </dd>
        <dt>Comments:</dt>
        <dd>
          <t>None</t>
        </dd>
      </dl>
      <t>An HTTP Proxy Error Type has been registered in the "HTTP Proxy Error Types" registry as
shown below:</t>
      <dl spacing="compact">
        <dt>Name:</dt>
        <dd>
          <t>incremental_refused</t>
        </dd>
        <dt>Description:</dt>
        <dd>
          <t>The HTTP message contained the Incremental HTTP header field, but the
intermediary refused to forward the message incrementally.</t>
        </dd>
        <dt>Extra Parameters:</dt>
        <dd>
          <t>none</t>
        </dd>
        <dt>Recommended HTTP Status Code:</dt>
        <dd>
          <t>501</t>
        </dd>
        <dt>Response Only Generated By Intermediaries:</dt>
        <dd>
          <t>true</t>
        </dd>
        <dt>Reference:</dt>
        <dd>
          <t>This document</t>
        </dd>
      </dl>
    </section>
  </middle>
  <back>
    <displayreference target="RFC6585" to="EXTRA-STATUS"/>
    <displayreference target="RFC9209" to="PROXY-STATUS"/>
    <displayreference target="RFC9651" to="STRUCTURED-FIELDS"/>
    <displayreference target="RFC9110" to="HTTP"/>
    <displayreference target="I-D.ietf-ohai-chunked-ohttp" to="CHUNKED-OHTTP"/>
    <references anchor="sec-combined-references">
      <name>References</name>
      <references anchor="sec-normative-references">
        <name>Normative References</name>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6585.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9209.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9651.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9110.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
      </references>
      <references anchor="sec-informative-references">
        <name>Informative References</name>
        <reference anchor="SSE" target="https://html.spec.whatwg.org/multipage/server-sent-events.html">
          <front>
            <title>HTML - Server-Sent Events</title>
            <author>
              <organization>WHATWG</organization>
            </author>
            <date/>
          </front>
          <annotation>Commit snapshot: <eref brackets="angle" target="https://html.spec.whatwg.org/commit-snapshots/6f84b26bd6eb8bd0e0e8df9819e43e901867166b/"/></annotation>
          <refcontent>WHATWG Living Standard</refcontent>
        </reference>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-ohai-chunked-ohttp.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8441.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9220.xml"/>
      </references>
    </references>

<section numbered="false" anchor="acknowledgments">
      <name>Acknowledgments</name>
      <t>The authors would like to thank many members of the IETF HTTP Working Group for
their discussions and feedback on this specification. In particular, the authors
would like to thank <contact fullname="Mark Thomas"/>, <contact fullname="Piotr Sikora"/>,
<contact fullname="Thibault Meunier"/>, <contact fullname="Marius Kleidl"/>, <contact fullname="Ben Schwartz"/>,
<contact fullname="Willy Tarreau"/>, <contact fullname="Will Hawkins"/>, <contact fullname="Mark Nottingham"/>, and
<contact fullname="Lucas Pardue"/> for close review and suggested changes.</t>
    </section>
  </back>

</rfc>
