You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 10, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 10, 2025. It is now read-only.
When the Save-Data header is present, PageSpeed should automatically adjust its filters and optimizations to reduce the amount of served bytes -- e.g. compress images with lower quality. Ideally, this should be an "on by default" behavior, but one that can be (re)configured by the site owner.
To support Save-Data, we'll add 2 new quality levels:
WebpQualityForSaveData
JpegQualityForSaveData
To enable this feature, and also make the optimized friendly to CDN/proxy, we'll add a new option:
AllowVaryOn.
AllowVaryOn will list the headers which the optimized images can vary on. Currently it will support these: Accept, User-Agent, and Save-Data. It can also be "Auto" by which PageSpeed will pick the proper list of header depends on whether the request has Via header or not.
WebpQualityForSaveData will be defaulted to 50, which is the quality used in Chrome Data Saver. JpegQualityForSaveData will be set to match WebP 50. I'll run some experiments to find out the exact value.
AllowVaryOn will be defaulted to "Auto". By "Auto" we'll try to use the most meaningful value for the user.
If the request has a "Via" header, we assume that it was through a CDN/proxy, so we will allow varying on "Accept" and "Save-Data" headers.
Otherwise, we assume that the request was from the user agent directly. We'll try all images formats supported by the UA, and will allow "User-Agent" and "Save-Data".
Activity
huibaolin commentedon Feb 8, 2016
To support Save-Data, we'll add 2 new quality levels:
To enable this feature, and also make the optimized friendly to CDN/proxy, we'll add a new option:
AllowVaryOn will list the headers which the optimized images can vary on. Currently it will support these: Accept, User-Agent, and Save-Data. It can also be "Auto" by which PageSpeed will pick the proper list of header depends on whether the request has Via header or not.
igrigorik commentedon Feb 8, 2016
@huibaolin great stuff, thanks! A couple of followup questions:
AllowVaryOnbe on by default? If not, what stops us from turning it on by default?huibaolin commentedon Feb 8, 2016
WebpQualityForSaveData will be defaulted to 50, which is the quality used in Chrome Data Saver. JpegQualityForSaveData will be set to match WebP 50. I'll run some experiments to find out the exact value.
AllowVaryOn will be defaulted to "Auto". By "Auto" we'll try to use the most meaningful value for the user.
Add support for the Save-Data client hint.
jeffkaufman commentedon Mar 7, 2016
Fixed by 1fef4af, e686449, 5da54d8, 6c0be2e, b98bf9a, 79eb6fa, c0b22d1, and b92ddc1. Squash-merged these to 408b027 for the 1.11 release.
Add support for the Save-Data client hint.
Add support for the Save-Data client hint.
Add support for the Save-Data client hint.
Add support for the Save-Data client hint.
Add support for the Save-Data client hint.
Add support for the Save-Data client hint.