draft-ietf-httpbis-early-hints-03.txt   draft-ietf-httpbis-early-hints-04.txt 
HTTP Working Group K. Oku HTTP Working Group K. Oku
Internet-Draft Fastly Internet-Draft Fastly
Intended status: Experimental June 20, 2017 Intended status: Experimental July 11, 2017
Expires: December 22, 2017 Expires: January 12, 2018
An HTTP Status Code for Indicating Hints An HTTP Status Code for Indicating Hints
draft-ietf-httpbis-early-hints-03 draft-ietf-httpbis-early-hints-04
Abstract Abstract
This memo introduces an informational HTTP status code that can be This memo introduces an informational HTTP status code that can be
used to convey hints that help a client make preparations for used to convey hints that help a client make preparations for
processing the final response. processing the final response.
Note to Readers Note to Readers
Discussion of this draft takes place on the HTTP working group Discussion of this draft takes place on the HTTP working group
skipping to change at page 1, line 42 skipping to change at page 1, line 42
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/. Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on December 22, 2017. This Internet-Draft will expire on January 12, 2018.
Copyright Notice Copyright Notice
Copyright (c) 2017 IETF Trust and the persons identified as the Copyright (c) 2017 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
skipping to change at page 2, line 22 skipping to change at page 2, line 22
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1. Notational Conventions . . . . . . . . . . . . . . . . . 3 1.1. Notational Conventions . . . . . . . . . . . . . . . . . 3
2. 103 Early Hints . . . . . . . . . . . . . . . . . . . . . . . 3 2. 103 Early Hints . . . . . . . . . . . . . . . . . . . . . . . 3
3. Security Considerations . . . . . . . . . . . . . . . . . . . 4 3. Security Considerations . . . . . . . . . . . . . . . . . . . 4
4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5
5. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 5 5. References . . . . . . . . . . . . . . . . . . . . . . . . . 5
6. Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 5.1. Normative References . . . . . . . . . . . . . . . . . . 5
6.1. Since draft-ietf-httpbis-early-hints-02 . . . . . . . . . 5 5.2. Informative References . . . . . . . . . . . . . . . . . 5
6.2. Since draft-ietf-httpbis-early-hints-01 . . . . . . . . . 5 Appendix A. Changes . . . . . . . . . . . . . . . . . . . . . . 6
6.3. Since draft-ietf-httpbis-early-hints-00 . . . . . . . . . 5 A.1. Since draft-ietf-httpbis-early-hints-03 . . . . . . . . . 6
7. References . . . . . . . . . . . . . . . . . . . . . . . . . 5 A.2. Since draft-ietf-httpbis-early-hints-02 . . . . . . . . . 6
7.1. Normative References . . . . . . . . . . . . . . . . . . 5 A.3. Since draft-ietf-httpbis-early-hints-01 . . . . . . . . . 6
7.2. Informative References . . . . . . . . . . . . . . . . . 6 A.4. Since draft-ietf-httpbis-early-hints-00 . . . . . . . . . 6
Appendix B. Acknowledgements . . . . . . . . . . . . . . . . . . 6
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 6 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 6
1. Introduction 1. Introduction
It is common for HTTP responses to contain links to external It is common for HTTP responses to contain links to external
resources that need to be fetched prior to their use; for example, resources that need to be fetched prior to their use; for example,
rendering HTML by a Web browser. Having such links available to the rendering HTML by a Web browser. Having such links available to the
client as early as possible helps to minimize perceived latency. client as early as possible helps to minimize perceived latency.
The "preload" ([Preload]) link relation can be used to convey such The "preload" ([Preload]) link relation can be used to convey such
skipping to change at page 3, line 35 skipping to change at page 3, line 35
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in [RFC2119]. document are to be interpreted as described in [RFC2119].
2. 103 Early Hints 2. 103 Early Hints
The 103 (Early Hints) informational status code indicates to the The 103 (Early Hints) informational status code indicates to the
client that the server is likely to send a final response with the client that the server is likely to send a final response with the
header fields included in the informational response. header fields included in the informational response.
A server MUST NOT include Content-Length, Transfer-Encoding, or any Typically, a server will include the header fields sent in a 103
hop-by-hop header fields ([RFC7230], Section 6.1) in a 103 (Early (Early Hints) response in the final response as well. However, there
Hints) response. might be cases when this is not desirable, such as when the server
learns that they are not correct before the final response is sent.
A client can speculatively evaluate the header fields included in a A client can speculatively evaluate the header fields included in a
103 (Early Hints) response while waiting for the final response. For 103 (Early Hints) response while waiting for the final response. For
example, a client might recognize a Link header field value example, a client might recognize a Link header field value
containing the relation type "preload" and start fetching the target containing the relation type "preload" and start fetching the target
resource. resource. However, these header fields only provide hints to the
client; they do not replace the header fields on the final response.
However, these header fields only provide hints to the client; they Aside from performance optimizations, such evaluation of the 103
do not replace the header fields on the final response. Aside from (Early Hints) response's header fields MUST NOT affect how the final
performance optimizations, such evaluation of the 103 (Early Hints) response is processed. A client MUST NOT interpret the 103 (Early
response's header fields MUST NOT affect how the final response is Hints) response header fields as if they applied to the informational
processed. A client MUST NOT interpret the 103 (Early Hints)
response header fields as if they applied to the informational
response itself (e.g., as metadata about the 103 (Early Hints) response itself (e.g., as metadata about the 103 (Early Hints)
response). response).
An intermediary MAY drop the informational response. It MAY send
HTTP/2 ([RFC7540]) server pushes using the information found in the
103 (Early Hints) response.
The following example illustrates a typical message exchange that The following example illustrates a typical message exchange that
involves a 103 (Early Hints) response. involves a 103 (Early Hints) response.
Client request: Client request:
GET / HTTP/1.1 GET / HTTP/1.1
Host: example.com Host: example.com
Server response: Server response:
skipping to change at page 4, line 33 skipping to change at page 4, line 29
HTTP/1.1 200 OK HTTP/1.1 200 OK
Date: Fri, 26 May 2017 10:02:11 GMT Date: Fri, 26 May 2017 10:02:11 GMT
Content-Length: 1234 Content-Length: 1234
Content-Type: text/html; charset=utf-8 Content-Type: text/html; charset=utf-8
Link: </style.css>; rel=preload; as=style Link: </style.css>; rel=preload; as=style
Link: </script.js>; rel=preload; as=script Link: </script.js>; rel=preload; as=script
<!doctype html> <!doctype html>
[... rest of the response body is ommitted from the example ...] [... rest of the response body is ommitted from the example ...]
As is the case with any informational response, a server might emit
more than one 103 (Early Hints) response prior to sending a final
response. This can happen for example when a caching intermediary
generates a 103 (Early Hints) response based on the header fields of
a stale-cached response, then forwards a 103 (Early Hints) response
and a final response that were sent from the origin server in
response to a revalidation request.
3. Security Considerations 3. Security Considerations
Some clients might have issues handling 103 (Early Hints), since Some clients might have issues handling 103 (Early Hints), since
informational responses are rarely used in reply to requests not informational responses are rarely used in reply to requests not
including an Expect header ([RFC7231], Section 5.1.1). including an Expect header field ([RFC7231], Section 5.1.1).
In particular, an HTTP/1.1 client that mishandles an informational In particular, an HTTP/1.1 client that mishandles an informational
response as a final response is likely to consider all responses to 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 succeeding requests sent over the same connection to be part of
the final response. Such behavior may constitute a cross-origin the final response. Such behavior might constitute a cross-origin
information disclosure vulnerability in case the client multiplexes information disclosure vulnerability in case the client multiplexes
requests to different origins onto a single persistent connection. requests to different origins onto a single persistent connection.
Therefore, a server might refrain from sending Early Hints over Therefore, a server might refrain from sending Early Hints over
HTTP/1.1 unless when the client is known to handle informational HTTP/1.1 unless the client is known to handle informational responses
responses correctly. correctly.
HTTP/2 clients are less likely to suffer from incorrect framing since HTTP/2 clients are less likely to suffer from incorrect framing since
handling of the response header fields does not affect how the end of handling of the response header fields does not affect how the end of
the response body is determined. the response body is determined.
4. IANA Considerations 4. IANA Considerations
The HTTP Status Codes Registry will be updated with the following The HTTP Status Codes Registry will be updated with the following
entry: entry:
o Code: 103 o Code: 103
o Description: Early Hints o Description: Early Hints
o Specification: [this document] o Specification: [this document]
5. Acknowledgements 5. References
Thanks to Tatsuhiro Tsujikawa for coming up with the idea of sending
the Link header fields using an informational response.
6. Changes
6.1. Since draft-ietf-httpbis-early-hints-02
o Editorial changes.
o Added an example.
6.2. Since draft-ietf-httpbis-early-hints-01
o Editorial changes.
6.3. Since draft-ietf-httpbis-early-hints-00
o Forbid processing the headers of a 103 response as part of the
informational response.
7. References
7.1. Normative References 5.1. Normative References
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997, DOI 10.17487/RFC2119, March 1997,
<http://www.rfc-editor.org/info/rfc2119>. <http://www.rfc-editor.org/info/rfc2119>.
[RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer
Protocol (HTTP/1.1): Message Syntax and Routing", Protocol (HTTP/1.1): Message Syntax and Routing",
RFC 7230, DOI 10.17487/RFC7230, June 2014, RFC 7230, DOI 10.17487/RFC7230, June 2014,
<http://www.rfc-editor.org/info/rfc7230>. <http://www.rfc-editor.org/info/rfc7230>.
skipping to change at page 6, line 15 skipping to change at page 5, line 48
[RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer
Protocol (HTTP/1.1): Semantics and Content", RFC 7231, Protocol (HTTP/1.1): Semantics and Content", RFC 7231,
DOI 10.17487/RFC7231, June 2014, DOI 10.17487/RFC7231, June 2014,
<http://www.rfc-editor.org/info/rfc7231>. <http://www.rfc-editor.org/info/rfc7231>.
[RFC7540] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext [RFC7540] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext
Transfer Protocol Version 2 (HTTP/2)", RFC 7540, Transfer Protocol Version 2 (HTTP/2)", RFC 7540,
DOI 10.17487/RFC7540, May 2015, DOI 10.17487/RFC7540, May 2015,
<http://www.rfc-editor.org/info/rfc7540>. <http://www.rfc-editor.org/info/rfc7540>.
7.2. Informative References 5.2. Informative References
[Preload] Grigorik, I., "Preload", n.d., <https://w3c.github.io/ [Preload] Grigorik, I., "Preload", n.d., <https://w3c.github.io/
preload/>. preload/>.
Appendix A. Changes
A.1. Since draft-ietf-httpbis-early-hints-03
o Removed statements that were either redundant or contradictory to
RFC7230-7234.
o Clarified what the server's expected behavior is.
o Explain that a server might want to send more than one 103
response.
o Editorial Changes.
A.2. Since draft-ietf-httpbis-early-hints-02
o Editorial changes.
o Added an example.
A.3. Since draft-ietf-httpbis-early-hints-01
o Editorial changes.
A.4. Since draft-ietf-httpbis-early-hints-00
o Forbid processing the headers of a 103 response as part of the
informational response.
Appendix B. Acknowledgements
Thanks to Tatsuhiro Tsujikawa for coming up with the idea of sending
the Link header fields using an informational response.
Author's Address Author's Address
Kazuho Oku Kazuho Oku
Fastly Fastly
Email: kazuhooku@gmail.com Email: kazuhooku@gmail.com
 End of changes. 16 change blocks. 
55 lines changed or deleted 72 lines changed or added

This html diff was produced by rfcdiff 1.45. The latest version is available from http://tools.ietf.org/tools/rfcdiff/