<?xml version="1.0" encoding="UTF-8"?>
  <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
  <!-- generated by https://github.com/cabo/kramdown-rfc2629 version 1.1.2 -->

<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
]>

<?rfc toc="yes"?>
<?rfc docindent="yes"?>
<?rfc sortrefs="yes"?>
<?rfc symrefs="yes"?>
<?rfc strict="yes"?>
<?rfc compact="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>

<rfc ipr="trust200902" docName="draft-ietf-httpbis-early-hints-02" category="exp">

  <feedback xmlns='http://purl.org/net/xml2rfc/ext' template="mailto:ietf-http-wg@w3.org?subject={docname},%20%22{section}%22&amp;body=%3c{ref}%3e:"/><front>
    <title abbrev="Early Hints">An HTTP Status Code for Indicating Hints</title>

    <author initials="K." surname="Oku" fullname="Kazuho Oku">
      <organization>DeNA Co., Ltd.</organization>
      <address>
        <email>kazuhooku@gmail.com</email>
      </address>
    </author>

    <date year="2017" month="5" day="16"/>

    <area>General</area>
    <workgroup>HTTP</workgroup>
    <keyword>Internet-Draft</keyword>

    <abstract>


<t>This memo introduces an informational HTTP status code that can be used to convey hints that
help a client make preparations for processing the final response.</t>



    </abstract>


    <note title="Note to Readers">


<t>Discussion of this draft 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/">https://lists.w3.org/Archives/Public/ietf-http-wg/</eref>.</t>

<t>Working Group information can be found at <eref target="https://httpwg.github.io/">https://httpwg.github.io/</eref>; source code and issues list
for this draft can be found at <eref target="https://github.com/httpwg/http-extensions/labels/early-hints">https://github.com/httpwg/http-extensions/labels/early-hints</eref>.</t>


    </note>


  </front>

  <middle>


<section anchor="introduction" title="Introduction">

<t>It is common for HTTP responses to contain links to external resources that need to be fetched
prior to their use; for example, rendering HTML by a Web browser. Having such links available to
the client as early as possible helps to minimize perceived latency.</t>

<t>The “preload” (<xref target="Preload"></xref>) link relation can be used to convey such links in the Link header field
of an HTTP response. However, it is not always possible for an origin server to generate a response
header block immediately after receiving a request. For example, the origin server might need to
query a database before generating a response, or it might delegate a request to an upstream HTTP
server running at a distant location.</t>

<t>The dilemma here is that even though it is preferable for an origin server to send some headers as
soon as it receives a request, it cannot do so until the status code and the full headers of the
final HTTP response are determined.</t>

<t>HTTP/2 (<xref target="RFC7540"></xref>) server push can be used as a solution to this issue, but has its own
limitations. The responses that can be pushed using HTTP/2 are limited to those belonging to the
same origin. Also, it is impossible to send only the links using server push. Finally, sending HTTP
responses for every resource is an inefficient way of using bandwidth, especially when a caching
server exists as an intermediary.</t>

<t>This memo defines a status code for sending an informational response (<xref target="RFC7231"></xref>, section 6.2) that
contains headers that are likely to be included in the final response. A server can send the
informational response containing some of the headers to help the client start making preparations
for processing the final response, and then run time-consuming operations to generate the final
response. The informational response can also be used by an origin server to trigger HTTP/2 server
push at a caching intermediary.</t>

<section anchor="notational-conventions" title="Notational Conventions">

<t>The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”,
“RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in
<xref target="RFC2119"></xref>.</t>

</section>
</section>
<section anchor="early-hints" title="103 Early Hints">

<t>The 103 (Early Hints) informational status code indicates the client that the server is likely to
send a final response with the headers included in the informational response.</t>

<t>A server MUST NOT include Content-Length, Transfer-Encoding, or any hop-by-hop header fields
(<xref target="RFC7230"></xref>, section 6.1) in a 103 (Early Hints) response.</t>

<t>A client MAY speculatively evaluate the headers included in a 103 (Early Hints) response while
waiting for the final response. For example, a client might recognize a Link header field value
containing the relation type “preload” and start fetching the target resource.</t>

<t>However, this MUST NOT affect how the final response is processed; when handling it, the client
MUST behave as if it had not seen the informational response. In particular, a client MUST NOT
process the headers included in the final response as if they belonged to the informational
response, or vice versa.</t>

<t>An intermediary MAY drop the informational response. It MAY send HTTP/2 (<xref target="RFC7540"></xref>) server pushes
using the information found in the 103 (Early Hints) response.</t>

</section>
<section anchor="security-considerations" title="Security Considerations">

<t>Some clients may have issues handling 103 (Early Hints), since informational responses are rarely
used in reply to requests not including an Expect header (<xref target="RFC7231"></xref>, section 5.1.1).</t>

<t>In particular, an HTTP/1.1 client that mishandles an informational response as a final response
is likely to consider all responses to the succeeding requests sent over the same connection to be
part of the final response. Such behavior may constitute a cross-origin information disclosure
vulnerability in case the client multiplexes requests to different origins onto a single persistent
connection.</t>

<t>Therefore, a server might refrain from sending Early Hints over HTTP/1.1 unless when the client is
known to handle informational responses correctly.</t>

<t>HTTP/2 clients are less likely to suffer from incorrect framing since handling of the response
headers does not affect how the end of the response body is determined.</t>

</section>
<section anchor="iana-considerations" title="IANA Considerations">

<t>The HTTP Status Codes Registry will be updated with the following entry:</t>

<t><list style="symbols">
  <t>Code: 103</t>
  <t>Description: Early Hints</t>
  <t>Specification: [this document]</t>
</list></t>

</section>
<section anchor="acknowledgements" title="Acknowledgements">

<t>Thanks to Tatsuhiro Tsujikawa for coming up with the idea of sending the link headers using an
informational response.</t>

</section>
<section anchor="changes" title="Changes">

<section anchor="since-draft-ietf-httpbis-early-hints-01" title="Since draft-ietf-httpbis-early-hints-01">

<t><list style="symbols">
  <t>Editorial changes.</t>
</list></t>

</section>
<section anchor="since-draft-ietf-httpbis-early-hints-00" title="Since draft-ietf-httpbis-early-hints-00">

<t><list style="symbols">
  <t>Forbid processing the headers of a 103 response as part of the informational response.</t>
</list></t>

</section>
</section>


  </middle>

  <back>

    <references title='Normative References'>





<reference  anchor="RFC2119" target='http://www.rfc-editor.org/info/rfc2119'>
<front>
<title>Key words for use in RFCs to Indicate Requirement Levels</title>
<author initials='S.' surname='Bradner' fullname='S. Bradner'><organization /></author>
<date year='1997' month='March' />
<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="RFC7230" target='http://www.rfc-editor.org/info/rfc7230'>
<front>
<title>Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing</title>
<author initials='R.' surname='Fielding' fullname='R. Fielding' role='editor'><organization /></author>
<author initials='J.' surname='Reschke' fullname='J. Reschke' role='editor'><organization /></author>
<date year='2014' month='June' />
<abstract><t>The Hypertext Transfer Protocol (HTTP) is a stateless application-level protocol for distributed, collaborative, hypertext information systems.  This document provides an overview of HTTP architecture and its associated terminology, defines the &quot;http&quot; and &quot;https&quot; Uniform Resource Identifier (URI) schemes, defines the HTTP/1.1 message syntax and parsing requirements, and describes related security concerns for implementations.</t></abstract>
</front>
<seriesInfo name='RFC' value='7230'/>
<seriesInfo name='DOI' value='10.17487/RFC7230'/>
</reference>



<reference  anchor="RFC7231" target='http://www.rfc-editor.org/info/rfc7231'>
<front>
<title>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</title>
<author initials='R.' surname='Fielding' fullname='R. Fielding' role='editor'><organization /></author>
<author initials='J.' surname='Reschke' fullname='J. Reschke' role='editor'><organization /></author>
<date year='2014' month='June' />
<abstract><t>The Hypertext Transfer Protocol (HTTP) is a stateless \%application- level protocol for distributed, collaborative, hypertext information systems.  This document defines the semantics of HTTP/1.1 messages, as expressed by request methods, request header fields, response status codes, and response header fields, along with the payload of messages (metadata and body content) and mechanisms for content negotiation.</t></abstract>
</front>
<seriesInfo name='RFC' value='7231'/>
<seriesInfo name='DOI' value='10.17487/RFC7231'/>
</reference>



<reference  anchor="RFC7540" target='http://www.rfc-editor.org/info/rfc7540'>
<front>
<title>Hypertext Transfer Protocol Version 2 (HTTP/2)</title>
<author initials='M.' surname='Belshe' fullname='M. Belshe'><organization /></author>
<author initials='R.' surname='Peon' fullname='R. Peon'><organization /></author>
<author initials='M.' surname='Thomson' fullname='M. Thomson' role='editor'><organization /></author>
<date year='2015' month='May' />
<abstract><t>This specification describes an optimized expression of the semantics of the Hypertext Transfer Protocol (HTTP), referred to as HTTP version 2 (HTTP/2).  HTTP/2 enables a more efficient use of network resources and a reduced perception of latency by introducing header field compression and allowing multiple concurrent exchanges on the same connection.  It also introduces unsolicited push of representations from servers to clients.</t><t>This specification is an alternative to, but does not obsolete, the HTTP/1.1 message syntax.  HTTP's existing semantics remain unchanged.</t></abstract>
</front>
<seriesInfo name='RFC' value='7540'/>
<seriesInfo name='DOI' value='10.17487/RFC7540'/>
</reference>




    </references>

    <references title='Informative References'>

<reference anchor="Preload" target="https://w3c.github.io/preload/">
  <front>
    <title>Preload</title>
    <author initials="I." surname="Grigorik">
      <organization></organization>
    </author>
    <date year="2016" month="September" day="16"/>
  </front>
</reference>


    </references>



  </back>

<!-- ##markdown-source:
H4sIABSWGlkAA5VY227cOBJ951cQzksy6Ivt7GSQziIYI/YkxjhxNnYwWARB
wJbYErclUktSbne+fk8VJbW6E3uwfrBpiazrqVNFTadTEU2s9EKeWfnu9vaj
vIkqtkG+cbmWK+flpc1NpqKxhXxnbAxCLZde3y3khfLVtnuWu8yqGlJyr1Zx
anRcTcsYm6UJU037piXtmx6filxF7Ds9PvlNQKwunN8upL5vhDCNX8jo2xBP
j49fYqvyWi3kW221V5XYOL8uvGubBRsq1nqLR/kCFkbtrY7Tc1IuRIjK5t9U
5SwUbXUQjVnIL9FlEwk7jc21jRMZnI9erwJW27pbRG8yvMpc3ahuUWMzXhlb
Gau/CqHaWDq/EHIqJH6MDQv550xer1v+P0XhT/W9Ld3w0PlCWfMdQXR2Ic/1
hzOEdzaRVzGf8QZdK1Mt5JqPuXX7e0EPZlAvhHW+xsk7DZ3y0x9vTk9OXnbL
306fH++WJ/3y13/gqTB2NT750evKqXzB+rqUd8/40eCXHNy6nMm33iBBZs2P
h8y9mB6/nJ68SKKUL3RcSMp2WMznm+fZrDCxbJcz4+ZN0jAXYjqdSrVEhBFY
IW5LE2StawdN0bu8zXSQysrBaGdVlf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