imageproxy icon indicating copy to clipboard operation
imageproxy copied to clipboard

Add support for client hint headers

Open willnorris opened this issue 10 years ago • 3 comments
trafficstars

Client Hints are defined by draft-grigorik-http-client-hints and are supported in the recently-released-to-stable Chrome 46. They allow user agents to provide additional hints regarding how the content is going to be rendered. Particularly interesting for imageproxy:

  • DPR (Device Pixel Ratio) - could be used to override the requested size options to accomodate higher DPR values
  • Width - override requested width, since the client hint indicates the width at which the image is actually going to be displayed
  • Downlink - could be used to change the default quality setting for JPEG images (?)

We may want to hide this behind a flag, at least for the time being, just to make sure it doesn't cause any problems. We'll also need to make sure and set an appropriate Vary header.

Further Reading:

  • https://developers.google.com/web/updates/2015/09/automating-resource-selection-with-client-hints
  • https://github.com/igrigorik/http-client-hints

willnorris avatar Oct 30 '15 16:10 willnorris

Add save-data to the list as well

willnorris avatar Feb 23 '16 05:02 willnorris

It's worth noting that https://tools.ietf.org/html/draft-grigorik-http-client-hints expired in February 2016.

@igrigorik: is that spec completely abandoned? Do you know if support is still present in Chrome or other browsers?

willnorris avatar Mar 28 '19 00:03 willnorris

@willnorris to the contrary, it is under active development! :)

@yoavweiss has a nice explainer and document on status of all the related plumbing: https://github.com/yoavweiss/client-hints-infrastructure/

igrigorik avatar Mar 28 '19 04:03 igrigorik