{"action":"created","issue":{"url":"https://api.github.com/repos/httpwg/http-extensions/issues/155","repository_url":"https://api.github.com/repos/httpwg/http-extensions","labels_url":"https://api.github.com/repos/httpwg/http-extensions/issues/155/labels{/name}","comments_url":"https://api.github.com/repos/httpwg/http-extensions/issues/155/comments","events_url":"https://api.github.com/repos/httpwg/http-extensions/issues/155/events","html_url":"https://github.com/httpwg/http-extensions/issues/155","id":140096510,"number":155,"title":"Define `Accept-CH` more precisely","user":{"login":"sicking","id":1831914,"avatar_url":"https://avatars.githubusercontent.com/u/1831914?v=3","gravatar_id":"","url":"https://api.github.com/users/sicking","html_url":"https://github.com/sicking","followers_url":"https://api.github.com/users/sicking/followers","following_url":"https://api.github.com/users/sicking/following{/other_user}","gists_url":"https://api.github.com/users/sicking/gists{/gist_id}","starred_url":"https://api.github.com/users/sicking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sicking/subscriptions","organizations_url":"https://api.github.com/users/sicking/orgs","repos_url":"https://api.github.com/users/sicking/repos","events_url":"https://api.github.com/users/sicking/events{/privacy}","received_events_url":"https://api.github.com/users/sicking/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/httpwg/http-extensions/labels/client-hints","name":"client-hints","color":"fbca04"},{"url":"https://api.github.com/repos/httpwg/http-extensions/labels/design","name":"design","color":"02d7e1"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-11T05:55:18Z","updated_at":"2016-05-04T15:26:06Z","closed_at":null,"body":"The spec currently says that if a server sends `Accept-CH: DPR`, then the `DPR` header should be added \"to all subsequent requests\".\r\n\r\nHowever it is (as far as I can tell) completely undefined what a \"subsequent request\" is. Does it affect only future requests to the server which sent the `Accept-CH` header? If the header is sent with the response during a document load, does it affect all requests coming from that document, no matter which server the request goes to?\r\n\r\nGenerally speaking, if a CDN which servers images has to send a `Accept-CH: DPR` header before it will receive any `DPR` headers, that means that the first image will have to be served without DPR information. This seems unfortunate since ideally the first image that a page loads is the most important image.\r\n\r\nA better solution is that when a browser loads a \"document\" and receives a `Accept-CH` header in the response, that header would affect all the requests that are made from that document, no matter which server the request is going to. If desired, in the future we could add more complex syntax to `Accept-CH` which enables opting in to certain CH headers only for certain servers and/or only for certain resource types.\r\n\r\nWe could also add a header which enables a server to opt in to getting specific CH headers for all future requests to that same server. To for example allow an image server to opt in to certain headers even if the document-serving server has not yet adopted the `Accept-CH` header. But I'm not sure how popular such a solution would be given first-load the problem mentioned above."},"comment":{"url":"https://api.github.com/repos/httpwg/http-extensions/issues/comments/216901306","html_url":"https://github.com/httpwg/http-extensions/issues/155#issuecomment-216901306","issue_url":"https://api.github.com/repos/httpwg/http-extensions/issues/155","id":216901306,"user":{"login":"igrigorik","id":10652,"avatar_url":"https://avatars.githubusercontent.com/u/10652?v=3","gravatar_id":"","url":"https://api.github.com/users/igrigorik","html_url":"https://github.com/igrigorik","followers_url":"https://api.github.com/users/igrigorik/followers","following_url":"https://api.github.com/users/igrigorik/following{/other_user}","gists_url":"https://api.github.com/users/igrigorik/gists{/gist_id}","starred_url":"https://api.github.com/users/igrigorik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/igrigorik/subscriptions","organizations_url":"https://api.github.com/users/igrigorik/orgs","repos_url":"https://api.github.com/users/igrigorik/repos","events_url":"https://api.github.com/users/igrigorik/events{/privacy}","received_events_url":"https://api.github.com/users/igrigorik/received_events","type":"User","site_admin":false},"created_at":"2016-05-04T15:26:05Z","updated_at":"2016-05-04T15:26:05Z","body":"We have ~1/2 of the solution in https://github.com/whatwg/fetch/commit/404dc3acfddb5e9870fdee333302f80ecff661dd#diff-1feda49b40370635faef8b655f144f64R1489. \r\n\r\nThe remaining bits are to define the \"parse the header\" algorithm (CH RFC, probably) and associate the policy with the environment settings object (HTML, probably.. see https://github.com/whatwg/fetch/commit/404dc3acfddb5e9870fdee333302f80ecff661dd#diff-1feda49b40370635faef8b655f144f64R900).\r\n\r\nI'll track progress for both of the above in https://github.com/httpwg/http-extensions/issues/156. Let's close this and continue there."}}