imageproxy
imageproxy copied to clipboard
Add support for client hint headers
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
Add save-data to the list as well
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 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/