<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.7.19 (Ruby 3.3.3) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-kazuho-httpbis-incremental-http-00" category="std" consensus="true" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.23.2 -->
  <front>
    <title>Incremental HTTP Messages</title>
    <seriesInfo name="Internet-Draft" value="draft-kazuho-httpbis-incremental-http-00"/>
    <author fullname="奥 一穂" asciiFullname="Kazuho Oku">
      <organization>Fastly</organization>
      <address>
        <email>kazuhooku@gmail.com</email>
      </address>
    </author>
    <author fullname="Tommy Pauly">
      <organization>Apple</organization>
      <address>
        <email>tpauly@apple.com</email>
      </address>
    </author>
    <author fullname="Martin Thomson">
      <organization>Mozilla</organization>
      <address>
        <email>mt@lowentropy.net</email>
      </address>
    </author>
    <date year="2024" month="October" day="15"/>
    <workgroup>httpbis</workgroup>
    <keyword>internet-draft</keyword>
    <abstract>
      <?line 39?>

<t>This document specifies the "Incremental" HTTP header field, which instructs
HTTP intermediaries to forward the HTTP message incrementally.</t>
    </abstract>
    <note removeInRFC="true">
      <name>Discussion Venues</name>
      <t>Discussion of this document takes place on the
    HTTP Working Group mailing list (ietf-http-wg@w3.org),
    which is archived at <eref target="https://lists.w3.org/Archives/Public/ietf-http-wg/"/>.</t>
      <t>Source for this draft and an issue tracker can be found at
    <eref target="https://github.com/kazuho/draft-kazuho-httpbis-incremental-http"/>.</t>
    </note>
  </front>
  <middle>
    <?line 45?>

<section anchor="introduction">
      <name>Introduction</name>
      <t>HTTP <xref target="HTTP"/> 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="CHUNKED-OHTTP"/>, the client opens an HTTP request
and incrementally sends application messages, while the server can start responding
even before the HTTP request is fully complete. In this way, the HTTP
request-response pair effectively serves as a bi-directional communication
channel.</t>
      <t>However, these applications 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="HTTP"/>).</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, when an intermediary tries to buffer the HTTP
response completely before forwarding it, the client might time out before
receiving any portion of the HTTP response.</t>
      <t>In the case of Chunked Oblivious HTTP Messages, when an intermediary tries to
buffer the entire HTTP request, the client will not start receiving application
messages from the server until the client closes the request, effectively
disrupting the intended incremental processing of the request.</t>
      <t>To help avoid such behavior, this document specifies the "Incremental" HTTP header
field, which instructs HTTP intermediaries to begin forwarding the HTTP message
downstream before receiving the complete message.</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>
      <?line -18?>

<t>The term Boolean is imported from <xref target="STRUCTURED-FIELDS"/>.</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>This header field has just one valid value of type Boolean: "?1".</t>
      <artwork><![CDATA[
Incremental = ?1
]]></artwork>
      <t>Upon receiving a header section that includes the Incremental header field, 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 body as they arrive.</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>The Incremental field is advisory. 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 can rely on prior knowledge or probe for support on
individual resources.</t>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <section anchor="applying-concurrency-limits">
        <name>Applying Concurrency Limits</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 503 Service Unavailable error, accompanied
by a connection_limit_reached Proxy-Status response header field
(<xref section="2.3.12" sectionFormat="of" target="PROXY-STATUS"/>).</t>
      </section>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>TBD</t>
    </section>
  </middle>
  <back>
    <references anchor="sec-combined-references">
      <name>References</name>
      <references anchor="sec-normative-references">
        <name>Normative References</name>
        <reference anchor="HTTP">
          <front>
            <title>HTTP Semantics</title>
            <author fullname="R. Fielding" initials="R." role="editor" surname="Fielding"/>
            <author fullname="M. Nottingham" initials="M." role="editor" surname="Nottingham"/>
            <author fullname="J. Reschke" initials="J." role="editor" surname="Reschke"/>
            <date month="June" year="2022"/>
            <abstract>
              <t>The Hypertext Transfer Protocol (HTTP) is a stateless application-level protocol for distributed, collaborative, hypertext information systems. This document describes the overall architecture of HTTP, establishes common terminology, and defines aspects of the protocol that are shared by all versions. In this definition are core protocol elements, extensibility mechanisms, and the "http" and "https" Uniform Resource Identifier (URI) schemes.</t>
              <t>This document updates RFC 3864 and obsoletes RFCs 2818, 7231, 7232, 7233, 7235, 7538, 7615, 7694, and portions of 7230.</t>
            </abstract>
          </front>
          <seriesInfo name="STD" value="97"/>
          <seriesInfo name="RFC" value="9110"/>
          <seriesInfo name="DOI" value="10.17487/RFC9110"/>
        </reference>
        <reference anchor="RFC2119">
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author fullname="S. Bradner" initials="S." surname="Bradner"/>
            <date month="March" year="1997"/>
            <abstract>
              <t>In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="2119"/>
          <seriesInfo name="DOI" value="10.17487/RFC2119"/>
        </reference>
        <reference anchor="RFC8174">
          <front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <author fullname="B. Leiba" initials="B." surname="Leiba"/>
            <date month="May" year="2017"/>
            <abstract>
              <t>RFC 2119 specifies common key words that may be used in protocol specifications. This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="8174"/>
          <seriesInfo name="DOI" value="10.17487/RFC8174"/>
        </reference>
        <reference anchor="STRUCTURED-FIELDS">
          <front>
            <title>Structured Field Values for HTTP</title>
            <author fullname="M. Nottingham" initials="M." surname="Nottingham"/>
            <author fullname="P-H. Kamp" surname="P-H. Kamp"/>
            <date month="February" year="2021"/>
            <abstract>
              <t>This document describes a set of data types and associated algorithms that are intended to make it easier and safer to define and handle HTTP header and trailer fields, known as "Structured Fields", "Structured Headers", or "Structured Trailers". It is intended for use by specifications of new HTTP fields that wish to use a common syntax that is more restrictive than traditional HTTP field values.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8941"/>
          <seriesInfo name="DOI" value="10.17487/RFC8941"/>
        </reference>
      </references>
      <references anchor="sec-informative-references">
        <name>Informative References</name>
        <reference anchor="PROXY-STATUS">
          <front>
            <title>The Proxy-Status HTTP Response Header Field</title>
            <author fullname="M. Nottingham" initials="M." surname="Nottingham"/>
            <author fullname="P. Sikora" initials="P." surname="Sikora"/>
            <date month="June" year="2022"/>
            <abstract>
              <t>This document defines the Proxy-Status HTTP response field to convey the details of an intermediary's response handling, including generated errors.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9209"/>
          <seriesInfo name="DOI" value="10.17487/RFC9209"/>
        </reference>
        <reference anchor="SSE" target="https://html.spec.whatwg.org/multipage/server-sent-events.html">
          <front>
            <title>Server-Sent Events</title>
            <author>
              <organization>WHATWG</organization>
            </author>
            <date>n.d.</date>
          </front>
        </reference>
        <reference anchor="CHUNKED-OHTTP">
          <front>
            <title>Chunked Oblivious HTTP Messages</title>
            <author fullname="Tommy Pauly" initials="T." surname="Pauly">
              <organization>Apple</organization>
            </author>
            <author fullname="Martin Thomson" initials="M." surname="Thomson">
              <organization>Mozilla</organization>
            </author>
            <date day="8" month="July" year="2024"/>
            <abstract>
              <t>   This document defines a variant of the Oblivious HTTP message format
   that allows chunks of requests and responses to be encrypted and
   decrypted before the entire request or response is processed.  This
   allows incremental processing of Oblivious HTTP messages, which is
   particularly useful for handling large messages or systems that
   process messages slowly.

              </t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-ohai-chunked-ohttp-01"/>
        </reference>
      </references>
    </references>
    <?line 167?>

<section numbered="false" anchor="acknowledgments">
      <name>Acknowledgments</name>
      <t>TODO acknowledge.</t>
    </section>
  </back>
  <!-- ##markdown-source:
H4sIAAAAAAAAA51Y3XLbuBW+x1OgzkW7O6ZiedPdRLPZxLGd2rN27EbypJmd
nQxEQhLWJMAFQCtMxplOn6Q3e9E36HWfpZ2+Rr8DkBRpK/3zeGwRAg7O+c53
/pgkCfPK53LCd051amUhtRc5P5nNLvm5dE4spdthmUm1KLAps2Lhk2vxoVqZ
ZOV9OVcuUZuDYS3Z22Op8HJpbD3hzmdsvZzwZjdTpZ1wbyvn9/f2nuzts2tZ
r43NJlxpL62WPgm3MOeFzt6J3GhcXEvHSjXhP3iT7nJnrLdy4fCpLujDj0xU
fmXshPGEcfwsqjwPKocnzicT/o9ffuF//+sf//mXPzVrwqUKIr8P1vCL6yqs
GwtlXwrn8zo8y0KofMKjzea6er6khVFqint38Zkpippfiqo5C1lCqw/CK6Mn
/KAsc9mX6Uva+VzQ+naB58J6pflsZQpn9BaZ5+aDynPRl1r457lZwx3WlPUI
eDKmjS1w4AZwMKUXmyfOL19f/OFtMp0dzK6mE/765eGT/b0nWJ9OjyN2Xtil
9NF/bvLw4coX+ciVMh2tV8KvlyMo9LCocq9KkOWhk/ZG2sTh/kTe4K8b0Yko
KjJtGrdM8SU/DlvCt50H6SdpfNT4483JwezN7xh+kiThYu68FSkMm62U42Bn
RfTjpJVaKOm4X8kBoXcio1dSZNJybMmzXb5eqXQF1kFYlUKJsCWQsJCZEjYI
MhxwrYXNgsywpYhxwXu8z+tRo1uhsgxeZg/4KXkgg2Q4ikXhHz/+iv4/JZjH
473bW17iMuUdtzKV8IgNN87lEk4vrUlxk9JLXoLvkOK4WQQVWKOCA4dJr5oL
a3F8l1uBR4s1oSHz50pZOo+1ggSvhfJkT7A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