Page MenuHomePhabricator

Support Save-Data header
Closed, DeclinedPublic

Description

The HTTP Working Group of IETF published a working draft HTTP Client Hints to defines a set of HTTP request header fields, which documented the Save-Data header to tell the server that the client need to reduce data usage. This header is suitable for mobile devices that accessing satellite internet.
See: https://tools.ietf.org/html/draft-ietf-httpbis-client-hints-04#section-3.5
A browser extension is available for test.
https://www.ctrl.blog/entry/http-save-data

In case of receiving Save-Data header, the MediaWiki server should activate a compressing mechanism to reduce the size of audios, images and videos, then send to the client.

https://nooshu.github.io/blog/2019/09/01/speeding-up-the-web-with-save-data-header/

It is also exposed to JavaScript for use in any client-side decisions.

if ( 'connection' in navigator && navigator.connection.saveData === true ) {
    // …
}

Event Timeline

I'm not sure 100% MobileFrontend would be the right place for this as it has no knowledge audio and images. I've added a bunch of tags to hopefully work out where such code should live.

Krinkle updated the task description. (Show Details)
Krinkle updated the task description. (Show Details)
Gilles subscribed.

This isn't actionable until a specific use of this header is proposed. Eg. compressing images further would be counter-productive in our current architecture, because our thumbnails are rendered on the fly. What you'd save on data would increase latency because the desired low quality image is more likely to be uncached than regular ones.

I suggest filing separate tasks with specific proposals on data saving.