| < draft-ietf-httpbis-client-hints-06.txt | draft-ietf-httpbis-client-hints-07.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 March 11, 2019 | |||
| Expires: January 17, 2019 | Expires: September 12, 2019 | |||
| HTTP Client Hints | HTTP Client Hints | |||
| draft-ietf-httpbis-client-hints-06 | draft-ietf-httpbis-client-hints-07 | |||
| 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/. | |||
| 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 | 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. | |||
| Status of This Memo | Status of This Memo | |||
| This Internet-Draft is submitted in full conformance with the | This Internet-Draft is submitted in full conformance with the | |||
| provisions of BCP 78 and BCP 79. | provisions of BCP 78 and BCP 79. | |||
| 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 September 12, 2019. | |||
| Copyright Notice | Copyright Notice | |||
| Copyright (c) 2018 IETF Trust and the persons identified as the | Copyright (c) 2019 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 | |||
| carefully, as they describe your rights and restrictions with respect | carefully, as they describe your rights and restrictions with respect | |||
| to this document. Code Components extracted from this document must | to this document. Code Components extracted from this document must | |||
| 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 . . . . . . . . . 5 | |||
| 2.2.3. Interaction with Caches . . . . . . . . . . . . . . . 6 | 2.2.3. Interaction with Caches . . . . . . . . . . . . . . . 6 | |||
| 3. Client Hints . . . . . . . . . . . . . . . . . . . . . . . . 6 | 3. Security Considerations . . . . . . . . . . . . . . . . . . . 7 | |||
| 3.1. The DPR Header Field . . . . . . . . . . . . . . . . . . 6 | 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 7 | |||
| 3.1.1. Confirming Selected DPR . . . . . . . . . . . . . . . 7 | 4.1. Accept-CH . . . . . . . . . . . . . . . . . . . . . . . . 8 | |||
| 3.2. The Width Header Field . . . . . . . . . . . . . . . . . 7 | 4.2. Accept-CH-Lifetime . . . . . . . . . . . . . . . . . . . 8 | |||
| 3.3. The Viewport-Width Header Field . . . . . . . . . . . . . 7 | 5. References . . . . . . . . . . . . . . . . . . . . . . . . . 8 | |||
| 4. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 8 | 5.1. Normative References . . . . . . . . . . . . . . . . . . 8 | |||
| 5. Security Considerations . . . . . . . . . . . . . . . . . . . 8 | 5.2. Informative References . . . . . . . . . . . . . . . . . 9 | |||
| 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 9 | 5.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 9 | |||
| 6.1. Accept-CH . . . . . . . . . . . . . . . . . . . . . . . . 9 | Appendix A. Interaction with Key Response Header Field . . . . . 9 | |||
| 6.2. Accept-CH-Lifetime . . . . . . . . . . . . . . . . . . . 9 | Appendix B. Changes . . . . . . . . . . . . . . . . . . . . . . 10 | |||
| 6.3. Content-DPR . . . . . . . . . . . . . . . . . . . . . . . 10 | B.1. Since -00 . . . . . . . . . . . . . . . . . . . . . . . . 10 | |||
| 6.4. DPR . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 | B.2. Since -01 . . . . . . . . . . . . . . . . . . . . . . . . 10 | |||
| 6.5. Viewport-Width . . . . . . . . . . . . . . . . . . . . . 10 | B.3. Since -02 . . . . . . . . . . . . . . . . . . . . . . . . 10 | |||
| 6.6. Width . . . . . . . . . . . . . . . . . . . . . . . . . . 10 | B.4. Since -03 . . . . . . . . . . . . . . . . . . . . . . . . 10 | |||
| 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 10 | B.5. Since -04 . . . . . . . . . . . . . . . . . . . . . . . . 10 | |||
| 7.1. Normative References . . . . . . . . . . . . . . . . . . 10 | B.6. Since -05 . . . . . . . . . . . . . . . . . . . . . . . . 10 | |||
| 7.2. Informative References . . . . . . . . . . . . . . . . . 12 | B.7. Since -06 . . . . . . . . . . . . . . . . . . . . . . . . 10 | |||
| 7.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 12 | B.8. Since -07 . . . . . . . . . . . . . . . . . . . . . . . . 11 | |||
| Appendix A. Interaction with Key Response Header Field . . . . . 12 | ||||
| Appendix B. Changes . . . . . . . . . . . . . . . . . . . . . . 12 | Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 11 | |||
| B.1. Since -00 . . . . . . . . . . . . . . . . . . . . . . . . 12 | Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 11 | |||
| B.2. Since -01 . . . . . . . . . . . . . . . . . . . . . . . . 13 | ||||
| B.3. Since -02 . . . . . . . . . . . . . . . . . . . . . . . . 13 | ||||
| B.4. Since -03 . . . . . . . . . . . . . . . . . . . . . . . . 13 | ||||
| B.5. Since -04 . . . . . . . . . . . . . . . . . . . . . . . . 13 | ||||
| B.6. Since -05 . . . . . . . . . . . . . . . . . . . . . . . . 13 | ||||
| B.7. Since -06 . . . . . . . . . . . . . . . . . . . . . . . . 13 | ||||
| Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 13 | ||||
| Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 13 | ||||
| 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 31 ¶ | |||
| 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 | |||
| request headers prolifically. This causes performance concerns | ||||
| (because it creates "bloat" in requests), as well as privacy issues; | ||||
| passively providing such information allows servers to silently | ||||
| 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 defines the Client Hints infrastructure, a framework | ||||
| that enables servers to opt-in to specific proactive content | ||||
| negotiation features, which will enable them to adapt their content | ||||
| accordingly. However, it does not define any specific features that | ||||
| will use that infrastructure. Those features will be defined in | ||||
| their respective specifications. | ||||
| This document does not supersede or replace the User-Agent header | ||||
| field. Existing device detection mechanisms can continue to use both | field. Existing device detection mechanisms can continue to use both | |||
| mechanisms if necessary. By advertising its capabilities within a | mechanisms if necessary. By advertising user agent capabilities | |||
| request header field, Client Hints allows for cache friendly and | within a request header field, Client Hints allow for cache friendly | |||
| proactive content negotiation. | 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 22 ¶ | |||
| 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. | |||
| "Content-DPR" response header field that needs to be returned by the | ||||
| server 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: | |||
| Accept-CH: DPR, Width, Viewport-Width | Accept-CH: Sec-CH-Example, Sec-CH-Example-2 | |||
| When a client receives an HTTP response advertising support for | When a client receives an HTTP response advertising support for | |||
| Client Hints, it should process it as origin ([RFC6454]) opt-in to | Client Hints, it should process it as origin ([RFC6454]) opt-in to | |||
| receive Client Hint header fields advertised in the field-value. The | receive Client Hint header fields advertised in the field-value. The | |||
| opt-in MUST be delivered over a secure transport. | opt-in MUST be delivered over a secure transport. | |||
| For example, based on Accept-CH example above, a user agent could | For example, based on Accept-CH example above, a user agent could | |||
| append DPR, Width, and Viewport-Width header fields to all same- | append the Sec-CH-Example and Sec-CH-Example-2 header fields to all | |||
| origin resource requests initiated by the page constructed from the | same-origin resource requests initiated by the page constructed from | |||
| response. | the response. | |||
| 2.2.2. The Accept-CH-Lifetime Header Field | 2.2.2. The Accept-CH-Lifetime Header Field | |||
| Servers can ask the client to remember the set of Client Hints that | Servers can ask the client to remember the set of Client Hints that | |||
| the server supports for a specified period of time, to enable | the server supports for a specified period of time, to enable | |||
| delivery of Client Hints on subsequent requests to the server's | delivery of Client Hints on subsequent requests to the server's | |||
| origin ([RFC6454]). | origin ([RFC6454]). | |||
| Accept-CH-Lifetime = #delta-seconds | Accept-CH-Lifetime = #delta-seconds | |||
| When a client receives an HTTP response that contains Accept-CH- | When a client receives an HTTP response that contains Accept-CH- | |||
| Lifetime header field, the field-value indicates that the Accept-CH | Lifetime header field, the field-value indicates that the Accept-CH | |||
| preference SHOULD be persisted and bound to the origin, and be | preference SHOULD be persisted and bound to the origin, and be | |||
| considered stale after response's age ([RFC7234], section 4.2) is | considered stale after response's age ([RFC7234], section 4.2) is | |||
| greater than the specified number of seconds. The preference MUST be | greater than the specified number of seconds. The preference MUST be | |||
| delivered over a secure transport, and MUST NOT be persisted for an | delivered over a secure transport, and MUST NOT be persisted for an | |||
| origin that isn't HTTPS. | origin that isn't HTTPS. | |||
| Accept-CH: DPR, Width | Accept-CH: Sec-CH-Example, Sec-CH-Example-2 | |||
| Accept-CH: Viewport-Width | Accept-CH: Sec-CH-Example-3 | |||
| Accept-CH-Lifetime: 86400 | Accept-CH-Lifetime: 86400 | |||
| For example, based on the Accept-CH and Accept-CH-Lifetime example | For example, based on the Accept-CH and Accept-CH-Lifetime example | |||
| above, which is received in response to a user agent navigating to | above, which is received in response to a user agent navigating to | |||
| "https://example.com", and delivered over a secure transport: a user | "https://example.com", and delivered over a secure transport: a user | |||
| agent SHOULD persist an Accept-CH preference bound to | agent SHOULD persist an Accept-CH preference bound to | |||
| "https://example.com" for up to 86400 seconds (1 day), and use it for | "https://example.com" for up to 86400 seconds (1 day), and use it for | |||
| user agent navigations to "https://example.com" and any same-origin | user agent navigations to "https://example.com" and any same-origin | |||
| resource requests initiated by the page constructed from the | resource requests initiated by the page constructed from the | |||
| navigation's response. This preference SHOULD NOT extend to resource | navigation's response. This preference SHOULD NOT extend to resource | |||
| skipping to change at page 6, line 26 ¶ | skipping to change at page 6, line 40 ¶ | |||
| value overrides all previous occurrences. | value overrides all previous occurrences. | |||
| 2.2.3. Interaction with Caches | 2.2.3. Interaction with Caches | |||
| When selecting an optimized response based on one or more Client | When selecting an optimized response based on one or more Client | |||
| Hints, and if the resource is cacheable, the server needs to generate | Hints, and if the resource is cacheable, the server needs to generate | |||
| a Vary response header field ([RFC7234]) to indicate which hints can | a Vary response header field ([RFC7234]) to indicate which hints can | |||
| affect the selected response and whether the selected response is | affect the selected response and whether the selected response is | |||
| appropriate for a later request. | appropriate for a later request. | |||
| Vary: DPR | Vary: Sec-CH-Example | |||
| Above example indicates that the cache key needs to include the DPR | ||||
| header field. | ||||
| Vary: DPR, Width | ||||
| Above example indicates that the cache key needs to include the DPR | ||||
| and Width header fields. | ||||
| 3. Client Hints | ||||
| 3.1. The DPR Header Field | ||||
| The "DPR" request header field is a number that indicates the | ||||
| client's current Device Pixel Ratio (DPR), which is the ratio of | ||||
| physical pixels over CSS px (Section 5.2 of [CSSVAL]) of the layout | ||||
| viewport (Section 9.1.1 of [CSS2]) on the device. | ||||
| DPR = 1*DIGIT [ "." 1*DIGIT ] | ||||
| If DPR occurs in a message more than once, the last value overrides | ||||
| all previous occurrences. | ||||
| 3.1.1. Confirming Selected DPR | ||||
| The "Content-DPR" response header field is a number that indicates | ||||
| the ratio between physical pixels over CSS px of the selected image | ||||
| response. | ||||
| Content-DPR = 1*DIGIT [ "." 1*DIGIT ] | ||||
| DPR ratio affects the calculation of intrinsic size of image | ||||
| resources on the client - i.e. typically, the client automatically | ||||
| scales the natural size of the image by the DPR ratio to derive its | ||||
| display dimensions. As a result, the server MUST explicitly indicate | ||||
| the DPR of the selected image response whenever the DPR hint is used, | ||||
| and the client MUST use the DPR value returned by the server to | ||||
| perform its calculations. In case the server returned Content-DPR | ||||
| value contradicts previous client-side DPR indication, the server | ||||
| returned value MUST take precedence. | ||||
| Note that DPR confirmation is only required for image responses, and | ||||
| the server does not need to confirm the resource width as this value | ||||
| can be derived from the resource itself once it is decoded by the | ||||
| client. | ||||
| If Content-DPR occurs in a message more than once, the last value | ||||
| overrides all previous occurrences. | ||||
| 3.2. The Width Header Field | ||||
| The "Width" request header field is a number that indicates the | ||||
| desired resource width in physical px (i.e. intrinsic size of an | ||||
| image). The provided physical px value is a number rounded to the | ||||
| smallest following integer (i.e. ceiling value). | ||||
| Width = 1*DIGIT | ||||
| If the desired resource width is not known at the time of the request | ||||
| or the resource does not have a display width, the Width header field | ||||
| can be omitted. If Width occurs in a message more than once, the | ||||
| last value overrides all previous occurrences. | ||||
| 3.3. The Viewport-Width Header Field | ||||
| The "Viewport-Width" request header field is a number that indicates | ||||
| the layout viewport width in CSS px. The provided CSS px value is a | ||||
| number rounded to the smallest following integer (i.e. ceiling | ||||
| value). | ||||
| Viewport-Width = 1*DIGIT | ||||
| If Viewport-Width occurs in a message more than once, the last value | ||||
| overrides all previous occurrences. | ||||
| 4. Examples | ||||
| For example, given the following request header fields: | ||||
| DPR: 2.0 | ||||
| Width: 320 | ||||
| Viewport-Width: 320 | ||||
| The server knows that the device pixel ratio is 2.0, that the | ||||
| intended display width of the requested resource is 160 CSS px (320 | ||||
| physical pixels at 2x resolution), and that the viewport width is 320 | ||||
| CSS px. | ||||
| If the server uses above hints to perform resource selection for an | Above example indicates that the cache key needs to include the Sec- | |||
| image asset, it must confirm its selection via the Content-DPR | CH-Example header field. | |||
| response header to allow the client to calculate the appropriate | ||||
| intrinsic size of the image response. The server does not need to | ||||
| confirm resource width, only the ratio between physical pixels and | ||||
| CSS px of the selected image resource: | ||||
| Content-DPR: 1.0 | Vary: Sec-CH-Example, Sec-CH-Example-2 | |||
| The Content-DPR response header field indicates to the client that | Above example indicates that the cache key needs to include the Sec- | |||
| the server has selected resource with DPR ratio of 1.0. The client | CH-Example and Sec-CH-Example-2 header fields. | |||
| can use this information to perform additional processing on the | ||||
| resource - for example, calculate the appropriate intrinsic size of | ||||
| the image resource such that it is displayed at the correct | ||||
| resolution. | ||||
| 5. Security Considerations | 3. 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 7, line 44 ¶ | |||
| 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 | 4. IANA Considerations | |||
| This document defines the "Accept-CH", "DPR", "Viewport-Width", and | This document defines the "Accept-CH" and "Accept-CH-Lifetime" HTTP | |||
| "Width" HTTP request fields, "Accept-CH", "Accept-CH-Lifetime", and | response fields, and registers them in the Permanent Message Header | |||
| "Content-DPR" HTTP response field, and registers them in the | Fields registry. | |||
| Permanent Message Header Fields registry. | ||||
| 6.1. Accept-CH | 4.1. Accept-CH | |||
| o Header field name: Accept-CH | o Header field name: Accept-CH | |||
| o Applicable protocol: HTTP | o Applicable protocol: HTTP | |||
| o Status: standard | o Status: standard | |||
| o Author/Change controller: IETF | o Author/Change controller: IETF | |||
| o Specification document(s): Section 2.2.1 of this document | o Specification document(s): Section 2.2.1 of this document | |||
| o Related information: for Client Hints | o Related information: for Client Hints | |||
| 6.2. Accept-CH-Lifetime | 4.2. Accept-CH-Lifetime | |||
| o Header field name: Accept-CH-Lifetime | o Header field name: Accept-CH-Lifetime | |||
| o Applicable protocol: HTTP | o Applicable protocol: HTTP | |||
| o Status: standard | o Status: standard | |||
| o Author/Change controller: IETF | o Author/Change controller: IETF | |||
| o Specification document(s): Section 2.2.2 of this document | o Specification document(s): Section 2.2.2 of this document | |||
| o Related information: for Client Hints | o Related information: for Client Hints | |||
| 6.3. Content-DPR | 5. References | |||
| o Header field name: Content-DPR | ||||
| o Applicable protocol: HTTP | ||||
| o Status: standard | ||||
| o Author/Change controller: IETF | ||||
| o Specification document(s): Section 3.1.1 of this document | ||||
| o Related information: for Client Hints | ||||
| 6.4. DPR | ||||
| o Header field name: DPR | ||||
| o Applicable protocol: HTTP | ||||
| o Status: standard | ||||
| o Author/Change controller: IETF | ||||
| o Specification document(s): Section 3.1 of this document | ||||
| o Related information: for Client Hints | ||||
| 6.5. Viewport-Width | ||||
| o Header field name: Viewport-Width | ||||
| o Applicable protocol: HTTP | ||||
| o Status: standard | ||||
| o Author/Change controller: IETF | ||||
| o Specification document(s): Section 3.3 of this document | ||||
| o Related information: for Client Hints | ||||
| 6.6. Width | ||||
| o Header field name: Width | ||||
| o Applicable protocol: HTTP | ||||
| o Status: standard | ||||
| o Author/Change controller: IETF | ||||
| o Specification document(s): Section 3.2 of this document | ||||
| o Related information: for Client Hints | ||||
| 7. References | ||||
| 7.1. Normative References | ||||
| [CSS2] Bos, B., Celic, T., Hickson, I., and H. Lie, "Cascading | ||||
| Style Sheets Level 2 Revision 1 (CSS 2.1) Specification", | ||||
| W3C Recommendation REC-CSS2-20110607, June 2011, | ||||
| <http://www.w3.org/TR/2011/REC-CSS2-20110607>. | ||||
| [CSSVAL] Atkins, T. and E. Etemad, "CSS Values and Units Module | 5.1. Normative References | |||
| Level 3", World Wide Web Consortium CR CR-css-values- | ||||
| 3-20160929, September 2016, | ||||
| <https://www.w3.org/TR/2016/CR-css-values-3-20160929>. | ||||
| [HTML5] Hickson, I., Berjon, R., Faulkner, S., Leithead, T., | [HTML5] Hickson, I., Berjon, R., Faulkner, S., Leithead, T., | |||
| Navara, E., O'Connor, T., and S. Pfeiffer, "HTML5", | Navara, E., O'Connor, T., and S. Pfeiffer, "HTML5", | |||
| World Wide Web Consortium Recommendation REC- | World Wide Web Consortium Recommendation REC- | |||
| html5-20141028, October 2014, | html5-20141028, October 2014, | |||
| <http://www.w3.org/TR/2014/REC-html5-20141028>. | <http://www.w3.org/TR/2014/REC-html5-20141028>. | |||
| [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, | |||
| skipping to change at page 12, line 5 ¶ | skipping to change at page 9, line 19 ¶ | |||
| [RFC7234] Fielding, R., Ed., Nottingham, M., Ed., and J. Reschke, | [RFC7234] Fielding, R., Ed., Nottingham, M., Ed., and J. Reschke, | |||
| Ed., "Hypertext Transfer Protocol (HTTP/1.1): Caching", | Ed., "Hypertext Transfer Protocol (HTTP/1.1): Caching", | |||
| RFC 7234, DOI 10.17487/RFC7234, June 2014, | RFC 7234, DOI 10.17487/RFC7234, June 2014, | |||
| <https://www.rfc-editor.org/info/rfc7234>. | <https://www.rfc-editor.org/info/rfc7234>. | |||
| [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC | [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC | |||
| 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, | 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, | |||
| May 2017, <https://www.rfc-editor.org/info/rfc8174>. | May 2017, <https://www.rfc-editor.org/info/rfc8174>. | |||
| 7.2. Informative References | 5.2. Informative References | |||
| [KEY] Fielding, R. and M. Nottingham, "The Key HTTP Response | [KEY] Fielding, R. and M. Nottingham, "The Key HTTP Response | |||
| Header Field", draft-ietf-httpbis-key-01 (work in | Header Field", draft-ietf-httpbis-key-01 (work in | |||
| progress), March 2016. | progress), March 2016. | |||
| [RFC6265] Barth, A., "HTTP State Management Mechanism", RFC 6265, | [RFC6265] Barth, A., "HTTP State Management Mechanism", RFC 6265, | |||
| DOI 10.17487/RFC6265, April 2011, | DOI 10.17487/RFC6265, April 2011, | |||
| <https://www.rfc-editor.org/info/rfc6265>. | <https://www.rfc-editor.org/info/rfc6265>. | |||
| 7.3. URIs | ||||
| [1] https://lists.w3.org/Archives/Public/ietf-http-wg/ | ||||
| [2] http://httpwg.github.io/ | ||||
| [3] https://github.com/httpwg/http-extensions/labels/client-hints | ||||
| Appendix A. Interaction with Key Response Header Field | Appendix A. Interaction with Key Response Header Field | |||
| Client Hints may be combined with Key response header field ([KEY]) | Client Hints may be combined with Key response header field ([KEY]) | |||
| to enable fine-grained control of the cache key for improved cache | to enable fine-grained control of the cache key for improved cache | |||
| efficiency. For example, the server can return the following set of | efficiency. For example, the server can return the following set of | |||
| instructions: | instructions: | |||
| Key: DPR;partition=1.5:2.5:4.0 | Key: Sec-CH-Example;partition=1.5:2.5:4.0 | |||
| Above example indicates that the cache key needs to include the value | Above example indicates that the cache key needs to include the value | |||
| of the DPR header field with three segments: less than 1.5, 1.5 to | of the Sec-CH-Example header field with three segments: less than | |||
| less than 2.5, and 4.0 or greater. | 1.5, 1.5 to less than 2.5, and 4.0 or greater. | |||
| Key: Width;div=320 | Key: Width;Sec-CH-Example=320 | |||
| Above example indicates that the cache key needs to include the value | Above example indicates that the cache key needs to include the value | |||
| of the Width header field and be partitioned into groups of 320: | of the Sec-CH-Example header field and be partitioned into groups of | |||
| 0-320, 320-640, and so on. | 320: 0-320, 320-640, and so on. | |||
| Appendix B. Changes | Appendix B. Changes | |||
| B.1. Since -00 | B.1. Since -00 | |||
| o Issue 168 (make Save-Data extensible) updated ABNF. | o Issue 168 (make Save-Data extensible) updated ABNF. | |||
| o Issue 163 (CH review feedback) editorial feedback from httpwg | o Issue 163 (CH review feedback) editorial feedback from httpwg | |||
| list. | list. | |||
| o Issue 153 (NetInfo API citation) added normative reference. | o Issue 153 (NetInfo API citation) added normative reference. | |||
| skipping to change at page 13, line 39 ¶ | skipping to change at page 11, line 5 ¶ | |||
| B.6. Since -05 | B.6. Since -05 | |||
| o Issue 372: Scoped CH opt-in and delivery to secure transports | o Issue 372: Scoped CH opt-in and delivery to secure transports | |||
| o Issue 373: Bind CH opt-in to origin | o Issue 373: Bind CH opt-in to origin | |||
| B.7. Since -06 | B.7. Since -06 | |||
| o Issue 524: Save-Data is now defined by NetInfo spec, dropping | o Issue 524: Save-Data is now defined by NetInfo spec, dropping | |||
| B.8. Since -07 | ||||
| o Removed specific features to be defined in other specifications | ||||
| Acknowledgements | Acknowledgements | |||
| Thanks to Mark Nottingham, Julian Reschke, Chris Bentzel, Yoav Weiss, | Thanks to Mark Nottingham, Julian Reschke, Chris Bentzel, Yoav Weiss, | |||
| Ben Greenstein, Tarun Bansal, Roy Fielding, Vasiliy Faronov, Ted | Ben Greenstein, Tarun Bansal, Roy Fielding, Vasiliy Faronov, Ted | |||
| Hardie, Jonas Sicking, and numerous other members of the IETF HTTP | Hardie, Jonas Sicking, and numerous other members of the IETF HTTP | |||
| Working Group for invaluable help and feedback. | Working Group for invaluable help and feedback. | |||
| Author's Address | Author's Address | |||
| Ilya Grigorik | Ilya Grigorik | |||
| End of changes. 38 change blocks. | ||||
| 245 lines changed or deleted | 117 lines changed or added | |||
This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ | ||||