draft-ietf-httpbis-client-hints-06.txt   draft-ietf-httpbis-client-hints-latest.txt 
HTTP Working Group I. Grigorik HTTP Working Group I. Grigorik
Internet-Draft Google Internet-Draft Google
Intended status: Experimental July 16, 2018 Intended status: Experimental December 5, 2018
Expires: January 17, 2019 Expires: June 8, 2019
HTTP Client Hints HTTP Client Hints
draft-ietf-httpbis-client-hints-06 draft-ietf-httpbis-client-hints-latest
Abstract Abstract
An increasing diversity of Web-connected devices and software HTTP defines proactive content negotiation to allow servers to select
capabilities has created a need to deliver optimized content for each the appropriate response for a given request, based upon the user
device. agent's characteristics, as expressed in request headers. In
practice, clients are often unwilling to send those request headers,
because it is not clear whether they will be used, and sending them
impacts both performance and privacy.
This specification defines an extensible and configurable set of HTTP This document defines two response headers, Accept-CH and Accept-CH-
request header fields, colloquially known as Client Hints, to address Lifetime, that servers can use to advertise their use of request
this. They are intended to be used as input to proactive content headers for proactive content negotiation, along with a set of
negotiation; just as the Accept header field allows user agents to guidelines for the creation of such headers, colloquially known as
indicate what formats they prefer, Client Hints allow user agents to "Client Hints."
indicate device and agent specific preferences.
It also defines an initial set of Client Hints.
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
mailing list (ietf-http-wg@w3.org), which is archived at mailing list (ietf-http-wg@w3.org), which is archived at
https://lists.w3.org/Archives/Public/ietf-http-wg/ [1]. https://lists.w3.org/Archives/Public/ietf-http-wg/ [1].
Working Group information can be found at http://httpwg.github.io/ Working Group information can be found at http://httpwg.github.io/
[2]; source code and issues list for this draft can be found at [2]; source code and issues list for this draft can be found at
https://github.com/httpwg/http-extensions/labels/client-hints [3]. https://github.com/httpwg/http-extensions/labels/client-hints [3].
skipping to change at page 1, line 49 skipping to change at page 2, line 7
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 https://datatracker.ietf.org/drafts/current/. Drafts is at https://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 January 17, 2019. This Internet-Draft will expire on June 8, 2019.
Copyright Notice Copyright Notice
Copyright (c) 2018 IETF Trust and the persons identified as the Copyright (c) 2018 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
(https://trustee.ietf.org/license-info) in effect on the date of (https://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 26 skipping to change at page 2, line 30
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
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 . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1. Notational Conventions . . . . . . . . . . . . . . . . . 4 1.1. Notational Conventions . . . . . . . . . . . . . . . . . 4
2. Client Hint Request Header Fields . . . . . . . . . . . . . . 4 2. Client Hint Request Header Fields . . . . . . . . . . . . . . 4
2.1. Sending Client Hints . . . . . . . . . . . . . . . . . . 4 2.1. Sending Client Hints . . . . . . . . . . . . . . . . . . 4
2.2. Server Processing of Client Hints . . . . . . . . . . . . 4 2.2. Server Processing of Client Hints . . . . . . . . . . . . 5
2.2.1. Advertising Support via Accept-CH Header Field . . . 5 2.2.1. Advertising Support via Accept-CH Header Field . . . 5
2.2.2. The Accept-CH-Lifetime Header Field . . . . . . . . . 5 2.2.2. The Accept-CH-Lifetime Header Field . . . . . . . . . 6
2.2.3. Interaction with Caches . . . . . . . . . . . . . . . 6 2.2.3. Interaction with Caches . . . . . . . . . . . . . . . 6
3. Client Hints . . . . . . . . . . . . . . . . . . . . . . . . 6 3. Client Hints . . . . . . . . . . . . . . . . . . . . . . . . 7
3.1. The DPR Header Field . . . . . . . . . . . . . . . . . . 6 3.1. The DPR Header Field . . . . . . . . . . . . . . . . . . 7
3.1.1. Confirming Selected DPR . . . . . . . . . . . . . . . 7 3.1.1. Confirming Selected DPR . . . . . . . . . . . . . . . 7
3.2. The Width Header Field . . . . . . . . . . . . . . . . . 7 3.2. The Width Header Field . . . . . . . . . . . . . . . . . 7
3.3. The Viewport-Width Header Field . . . . . . . . . . . . . 7 3.3. The Viewport-Width Header Field . . . . . . . . . . . . . 8
4. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 8 4. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 8
5. Security Considerations . . . . . . . . . . . . . . . . . . . 8 5. Security Considerations . . . . . . . . . . . . . . . . . . . 9
6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 9 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 10
6.1. Accept-CH . . . . . . . . . . . . . . . . . . . . . . . . 9 6.1. Accept-CH . . . . . . . . . . . . . . . . . . . . . . . . 10
6.2. Accept-CH-Lifetime . . . . . . . . . . . . . . . . . . . 9 6.2. Accept-CH-Lifetime . . . . . . . . . . . . . . . . . . . 10
6.3. Content-DPR . . . . . . . . . . . . . . . . . . . . . . . 10 6.3. Content-DPR . . . . . . . . . . . . . . . . . . . . . . . 10
6.4. DPR . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 6.4. DPR . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
6.5. Viewport-Width . . . . . . . . . . . . . . . . . . . . . 10 6.5. Viewport-Width . . . . . . . . . . . . . . . . . . . . . 10
6.6. Width . . . . . . . . . . . . . . . . . . . . . . . . . . 10 6.6. Width . . . . . . . . . . . . . . . . . . . . . . . . . . 11
7. References . . . . . . . . . . . . . . . . . . . . . . . . . 10 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 11
7.1. Normative References . . . . . . . . . . . . . . . . . . 10 7.1. Normative References . . . . . . . . . . . . . . . . . . 11
7.2. Informative References . . . . . . . . . . . . . . . . . 12 7.2. Informative References . . . . . . . . . . . . . . . . . 12
7.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 12 7.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Appendix A. Interaction with Key Response Header Field . . . . . 12 Appendix A. Interaction with Key Response Header Field . . . . . 12
Appendix B. Changes . . . . . . . . . . . . . . . . . . . . . . 12 Appendix B. Changes . . . . . . . . . . . . . . . . . . . . . . 13
B.1. Since -00 . . . . . . . . . . . . . . . . . . . . . . . . 12 B.1. Since -00 . . . . . . . . . . . . . . . . . . . . . . . . 13
B.2. Since -01 . . . . . . . . . . . . . . . . . . . . . . . . 13 B.2. Since -01 . . . . . . . . . . . . . . . . . . . . . . . . 13
B.3. Since -02 . . . . . . . . . . . . . . . . . . . . . . . . 13 B.3. Since -02 . . . . . . . . . . . . . . . . . . . . . . . . 13
B.4. Since -03 . . . . . . . . . . . . . . . . . . . . . . . . 13 B.4. Since -03 . . . . . . . . . . . . . . . . . . . . . . . . 13
B.5. Since -04 . . . . . . . . . . . . . . . . . . . . . . . . 13 B.5. Since -04 . . . . . . . . . . . . . . . . . . . . . . . . 13
B.6. Since -05 . . . . . . . . . . . . . . . . . . . . . . . . 13 B.6. Since -05 . . . . . . . . . . . . . . . . . . . . . . . . 14
B.7. Since -06 . . . . . . . . . . . . . . . . . . . . . . . . 13 B.7. Since -06 . . . . . . . . . . . . . . . . . . . . . . . . 14
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 13 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 14
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 13 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 14
1. Introduction 1. Introduction
There are thousands of different devices accessing the web, each with There are thousands of different devices accessing the web, each with
different device capabilities and preference information. These different device capabilities and preference information. These
device capabilities include hardware and software characteristics, as device capabilities include hardware and software characteristics, as
well as dynamic user and client preferences. well as dynamic user and client preferences.
One way to infer some of these capabilities is through User-Agent One way to infer some of these capabilities is through User-Agent
(Section 5.5.3 of [RFC7231]) header field detection against an (Section 5.5.3 of [RFC7231]) header field detection against an
skipping to change at page 3, line 34 skipping to change at page 3, line 40
limitations: limitations:
o User agent detection cannot reliably identify all static variables o User agent detection cannot reliably identify all static variables
o User agent detection cannot infer any dynamic client preferences o User agent detection cannot infer any dynamic client preferences
o User agent detection requires an external device database o User agent detection requires an external device database
o User agent detection is not cache friendly o User agent detection is not cache friendly
A popular alternative strategy is to use HTTP cookies ([RFC6265]) to A popular alternative strategy is to use HTTP cookies ([RFC6265]) to
communicate some information about the user agent. However, this communicate some information about the user agent. However, this
approach is also not cache friendly, bound by same origin policy, and approach is also not cache friendly, bound by same origin policy, and
imposes additional client-side latency by requiring JavaScript often imposes additional client-side latency by requiring JavaScript
execution to create and manage HTTP cookies. execution to create and manage HTTP cookies.
This document defines a set of new request header fields that allow Proactive content negotiation (Section 3.4.1 of [RFC7231]) offers an
user agent to perform proactive content negotiation (Section 3.4.1 of alternative approach; user agents use specified, well-defined request
[RFC7231]) by indicating device and agent specific preferences, headers to advertise their capabilities and characteristics, so that
through a mechanism similar to the Accept header field which is used servers can select (or formulate) an appropriate response.
to indicate preferred response formats.
Client Hints does not supersede or replace the User-Agent header However, proactive content negotiation requires clients to send these
field. Existing device detection mechanisms can continue to use both request headers prolifically. This causes performance concerns
mechanisms if necessary. By advertising its capabilities within a (because it creates "bloat" in requests), as well as privacy issues;
request header field, Client Hints allows for cache friendly and passively providing such information allows servers to silently
proactive content negotiation. fingerprint the user agent.
This document defines a new response header, Accept-CH, that allows
an origin server to explicitly ask that clients send these headers in
requests, for a period of time bounded by the Accept-CH-Lifetime
response header. It also defines guidelines for content negotiation
mechanisms that use it, colloquially referred to as Client Hints.
Client Hints mitigate the performance concerns by assuring that
clients will only send the request headers when they're actually
going to be used, and the privacy concerns of passive fingerprinting
by requiring explicit opt-in and disclosure of required headers by
the server through the use of the Accept-CH response header.
This document also defines an initial set of Client Hints.
It does not supersede or replace the User-Agent header field.
Existing device detection mechanisms can continue to use both
mechanisms if necessary. By advertising user agent capabilities
within a request header field, Client Hints allow for cache friendly
and proactive content negotiation.
1.1. Notational Conventions 1.1. Notational Conventions
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in BCP "OPTIONAL" in this document are to be interpreted as described in BCP
14 [RFC2119] [RFC8174] when, and only when, they appear in all 14 [RFC2119] [RFC8174] when, and only when, they appear in all
capitals, as shown here. capitals, as shown here.
This document uses the Augmented Backus-Naur Form (ABNF) notation of This document uses the Augmented Backus-Naur Form (ABNF) notation of
skipping to change at page 5, line 4 skipping to change at page 5, line 24
When presented with a request that contains one or more client hint When presented with a request that contains one or more client hint
header fields, servers can optimize the response based upon the header fields, servers can optimize the response based upon the
information in them. When doing so, and if the resource is information in them. When doing so, and if the resource is
cacheable, the server MUST also generate a Vary response header field cacheable, the server MUST also generate a Vary response header field
(Section 7.1.4 of [RFC7231]) to indicate which hints can affect the (Section 7.1.4 of [RFC7231]) to indicate which hints can affect the
selected response and whether the selected response is appropriate selected response and whether the selected response is appropriate
for a later request. for a later request.
Further, depending on the hint used, the server can generate Further, depending on the hint used, the server can generate
additional response header fields to convey related values to aid additional response header fields to convey related values to aid
client processing. For example, this specification defines the client processing. For example, this document defines the "Content-
"Content-DPR" response header field that needs to be returned by the DPR" response header field that needs to be returned by the server
server when the "DPR" hint is used to select the response. when the "DPR" hint is used to select the response.
2.2.1. Advertising Support via Accept-CH Header Field 2.2.1. Advertising Support via Accept-CH Header Field
Servers can advertise support for Client Hints using the Accept-CH Servers can advertise support for Client Hints using the Accept-CH
header field or an equivalent HTML meta element with http-equiv header field or an equivalent HTML meta element with http-equiv
attribute ([HTML5]). attribute ([HTML5]).
Accept-CH = #field-name Accept-CH = #field-name
For example: For example:
skipping to change at page 8, line 39 skipping to change at page 9, line 9
The Content-DPR response header field indicates to the client that The Content-DPR response header field indicates to the client that
the server has selected resource with DPR ratio of 1.0. The client the server has selected resource with DPR ratio of 1.0. The client
can use this information to perform additional processing on the can use this information to perform additional processing on the
resource - for example, calculate the appropriate intrinsic size of resource - for example, calculate the appropriate intrinsic size of
the image resource such that it is displayed at the correct the image resource such that it is displayed at the correct
resolution. resolution.
5. Security Considerations 5. Security Considerations
The request header fields defined in this specification, and those The request header fields defined in this document, and those that
that extend it, expose information about the user's environment to extend it, expose information about the user's environment to enable
enable proactive content negotiation. Such information may reveal proactive content negotiation. Such information may reveal new
new information about the user and implementers ought to consider the information about the user and implementers ought to consider the
following considerations, recommendations, and best practices. following considerations, recommendations, and best practices.
Transmitted Client Hints header fields SHOULD NOT provide new Transmitted Client Hints header fields SHOULD NOT provide new
information that is otherwise not available to the application via information that is otherwise not available to the application via
other means, such as using HTML, CSS, or JavaScript. Further, other means, such as using HTML, CSS, or JavaScript. Further,
sending highly granular data, such as image and viewport width may sending highly granular data, such as image and viewport width may
help identify users across multiple requests. Reducing the set of help identify users across multiple requests. Reducing the set of
field values that can be expressed, or restricting them to an field values that can be expressed, or restricting them to an
enumerated range where the advertised value is close but is not an enumerated range where the advertised value is close but is not an
exact representation of the current value, can improve privacy and exact representation of the current value, can improve privacy and
skipping to change at page 9, line 27 skipping to change at page 9, line 46
balance privacy concerns with bandwidth limitations. However, balance privacy concerns with bandwidth limitations. However,
implementers should also be aware that explaining the privacy implementers should also be aware that explaining the privacy
implications of passive fingerprinting to users may be implications of passive fingerprinting to users may be
challenging. challenging.
o Implementations specific to certain use cases or threat models MAY o Implementations specific to certain use cases or threat models MAY
avoid transmitting some or all of Client Hints header fields. For avoid transmitting some or all of Client Hints header fields. For
example, avoid transmission of header fields that can carry higher example, avoid transmission of header fields that can carry higher
risks of linkability. risks of linkability.
Implementers SHOULD support Client Hints opt-in mechanisms and MUST Implementers SHOULD support Client Hints opt-in mechanisms and MUST
clear persisted opt-in preferences when site data, browsing history, clear persisted opt-in preferences when any one of site data,
browsing cache, or similar, are cleared. browsing history, browsing cache, or similar, are cleared.
6. IANA Considerations 6. IANA Considerations
This document defines the "Accept-CH", "DPR", "Viewport-Width", and This document defines the "Accept-CH", "DPR", "Viewport-Width", and
"Width" HTTP request fields, "Accept-CH", "Accept-CH-Lifetime", and "Width" HTTP request fields, "Accept-CH", "Accept-CH-Lifetime", and
"Content-DPR" HTTP response field, and registers them in the "Content-DPR" HTTP response field, and registers them in the
Permanent Message Header Fields registry. Permanent Message Header Fields registry.
6.1. Accept-CH 6.1. Accept-CH
 End of changes. 20 change blocks. 
51 lines changed or deleted 75 lines changed or added

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