Merge pull request #48 from housseindjirdeh/update-data-saver-compression-docs

Update data saver compression docs
This commit is contained in:
Meggin Kearney 2019-03-06 11:55:03 -08:00 коммит произвёл GitHub
Родитель 64741e2668 a938015a90
Коммит e271fea034
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 13 добавлений и 135 удалений

Просмотреть файл

@ -11,7 +11,7 @@ This is the source of the official [Chrome Multi-Device documentation](https://d
2. Open [http://localhost:8000/_preview.html](http://localhost:8000/_preview.html)
3. You will see the boilerplate with the index.html file already included
4. To preview another document, add a url paramater with the filename
* Something like: [http://localhost:8000/_preview.html?data-compression.html](http://localhost:8000/_preview.html?data-compression.html)
* Something like: [http://localhost:8000/_preview.html?data-compression-for-isps.html](http://localhost:8000/_preview.html?data-compression-for-isps.html)
* Or: [http://localhost:8888/_preview.html?webview/gettingstarted.html](http://localhost:8888/_preview.html?webview/gettingstarted.html)
* Things mostly work but is not exactly the same as viewing through DCC.

Просмотреть файл

@ -14,22 +14,26 @@ users and URLs.
<h2 id="proxy-connection">Proxy Connection</h2>
<p>
Enabling the <a href="data-compression.html">Data Saver</a> feature
in Chrome establishes a connection between the browser and Google's
servers to proxy HTTP requests. HTTPS requests and pages loaded in
Incognito tabs are not proxied.
Enabling the
<a href="https://support.google.com/chrome/answer/2392284?co=GENIE.Platform%3DAndroid&hl=en">Data Saver</a>
feature in Chrome establishes a connection between the browser and Google's
servers to proxy HTTP requests. Pages loaded in
Incognito tabs are never proxied or optimized. In the vast majority of cases,
HTTPS traffic is not affected by Data Saver. On extremely slow page loads, Chrome
will redirect to a Google-hosted domain which serves a transcoded version of the
page to save data and load faster. This is only used on very slow page loads, or
when the page might fail to load at all.
</p>
<p>
When possible, the proxy connection is encrypted using SSL, and uses the
HTTP/2 protocol to optimize data transfers. In certain cases, as described
When possible, the proxy connection is encrypted using SSL. In certain cases, as described
below, the proxy connection may use unencrypted HTTP/1.1.
</p>
<p>
Google's proxy servers perform various optimizations on the Web page
content, with the goal of reducing bandwidth usage. The DCP transcodes
images to the WebP format, reduces image quality, compresses and minifies
content, with the goal of reducing bandwidth usage and improving performance. The DCP
transcodes images to the WebP format, reduces image quality, compresses and minifies
Javascript and CSS resources, and applies gzip and other transport-level
compression.
</p>

Просмотреть файл

@ -1,126 +0,0 @@
{{+bindTo:partials.standard_multidevice_article}}
<h1>Data Saver</h1>
<p>Get faster, safer, and cheaper web browsing with data compression.</p>
<section class="collapsible">
<h2 id="reduce-data-usage">Reduce data usage</h2>
<p>
<a href="https://play.google.com/store/apps/details?id=com.android.chrome">Chrome for Android</a> can significantly reduce cellular data usage by using proxy servers hosted at Google to optimize website content. This feature has been shown to <strong>reduce the size of web pages by 60%.</strong> To enable it, visit <b>Settings &gt; Data Saver</b> and toggle the option.
</p>
<p>
Data Saver is also available as an extension for Chrome desktop and ChromeOS. <a href="https://chrome.google.com/webstore/detail/data-saver-beta/pfmgfdlgomnbgkofeojodiodmgpgmkac">Get the Data Saver extension here.</a>
</p>
<p>
Network administrators, carriers, and ISPs should consult <a href="data-compression-for-isps.html">this accompanying article</a> for technical details on the Data Saver proxy. This <a href="https://www.usenix.org/conference/nsdi15/technical-sessions/presentation/agababov">paper published at NSDI 2015</a> provides more technical details on the Data Saver proxy.
</p>
</section>
<section class="collapsible">
<h2 id="features">Features and implementation</h2>
<p>
The core optimizations that allow us to reduce overall data usage are performed by Google servers. When Data Saver is enabled, Chrome opens a connection between your phone and one of the optimization servers running in Google's datacenters and relays all non-encrypted HTTP requests over this connection.
</p>
<figure><img alt="How data compression proxy works" src="images/data-compression/compression-proxy.png"></figure>
<p>
The proxy server receives the request initiated on your device, initiates a request for the required resource on your behalf, and then optimizes each response before delivering it back to the client. The content optimization is performed by our <a href="https://developers.google.com/speed/pagespeed/">open-source PageSpeed libraries</a>, which are specifically tuned for Chrome. The rendering of the page, and all JavaScript execution, is performed by the clients browser.
</p>
<p>For your security and privacy:</p>
<ul>
<li>Secure connections (HTTPS) are routed directly from your device to the destination, bypassing the compression proxy.</li>
<li>The use of the compression proxy does not require a Google account.</li>
<li>Navigation in incognito tabs bypasses the compression proxy.</li>
</ul>
<p>
Curious to see the bandwidth savings provided by the proxy? Visit your browser settings to see a graph of the original data size vs. the optimized version that your browser received. The bandwidth savings add up quickly!
</p>
<figure><img alt="Bandwidth usage" src="images/data-compression/bandwidth-usage.png"></figure>
<p>
Lets take a closer look at some of the specific optimizations enabled by the data compression proxy.
</p>
<h3 id="spdy">HTTP/2 for speed</h3>
<p>
Where possible the connection from the browser to the proxy runs over <a href="http://tools.ietf.org/html/draft-ietf-httpbis-http2/">HTTP/2</a>. If an HTTP/2 connection cannot be made, a regular HTTP/1.1 proxy connection is established.
</p>
<figure><img alt="HTTP/2 to http-https" src="images/data-compression/http-https.png"></figure>
<p>
By using HTTP/2, the proxy is able to multiplex multiple request and response streams in parallel over a single TCP connection, which has numerous performance benefits: it amortizes TCP handshake overhead for multiple requests, enables higher throughput by removing the TCP slow-start phase incurred by each new connection, and enables intelligent request and response prioritization between the streams.
</p>
<p>
Further, there are many additional benefits to using the compression proxy:
</p>
<ul>
<li>DNS late-binding: DNS lookups are performed by the proxy, instead of on the phone, which means that the resolutions can be done much, much quicker.</li>
<li>Less network activity and faster load times also mean that the mobile radio has to be active for shorter periods of time!</li>
</ul>
<h3 id="content-optimization">Content optimization</h3>
<p>
Unfortunately, many web-sites are not optimized for the mobile web, which results in inefficient content delivery and slow rendering times. However, our experience with PageSpeed shows that many content optimizations can, in fact, be automated, which is precisely what the data compression proxy does on your behalf!
</p>
<p>
<strong>Transcoding images:</strong>
Over 60% of the transferred bytes, for an average page, are images. Hence, the proxy takes great care to optimize and transcode all images to the <a href="https://developers.google.com/speed/webp/">WebP</a> format, which requires fewer bytes than other popular formats, such as JPEG and PNG. The proxy supports the new
<a href="https://developers.google.com/speed/webp/docs/webp_lossless_bitstream_specification">WebP lossless format</a> for certain images, and also optimizes the perceptual quality of each image based on device screen resolution and pixel density of your device. By combining all these features the resulting images are up to 80% smaller!
</p>
<p>
<strong>Content-aware compression:</strong>
The proxy performs intelligent compression and minification of HTML, JavaScript and CSS resources, which removes unnecessary whitespace, comments, and other metadata which is not essential to the rendering of the page. These optimizations, combined with mandatory gzip compression for all resources, can yield substantial bandwidth savings for the client.
</p>
<p>
<strong>Safer, more secure browsing:</strong>
The proxy implements <a href="http://blog.chromium.org/2012/01/all-about-safe-browsing.html">Safe Browsing</a> for Chrome Mobile, by informing the browser when you attempt to visit a known malware or phishing site. This causes a warning page to be displayed, which you can click through if you wish to visit the site. The list of harmful sites is continuously updated on the proxy.
</p>
<h3 id="faster-mobile-web">Building a faster mobile web</h3>
<p>
This is just the beginning of what a powerful proxy service can provide to make the mobile web experience more efficient and enjoyable, regardless of whether you are on a latest 4G connection, or using an older generation mobile network. We are continuously improving the service and experimenting with new optimizations &mdash; stay tuned for more.
</p>
</section>
<section class="collapsible">
<h2 id="faq">Frequently asked questions</h3>
<ul>
<li><strong>Is my secure traffic optimized by the compression proxy?</strong><br>
No, data compression proxy operates on non-encrypted traffic: HTTPS requests are sent directly from your device to the destination server.</li>
<li><strong>Can I detect if the user has Data Compression Proxy turned on?</strong><br>
Yes, kind of. As of Chrome 49 (Beta in Feb 2nd 2016, Estimated stable date in late March) when the user has enabled the Data Saver feature in Chrome, Chrome will add a <code>save-data</code> HTTP Header with the value '<code>on</code>' to each HTTP Request. The
HTTP Header will not be present when the feature is turned off. Use this as a signal of intent from the user that they
are conscious of the amount of data that they are using and not that their connection is going through the Data Compression Proxy. For instance, the HTTP Header will be set when the user visits a site over HTTPS even though secure connections are not passed through
the Data Compression Proxy.</li>
<li><strong>As a site owner, how do I perform IP geo-targeting?</strong><br>
The IP address of your device is forwarded to the destination server via the <code>X-Forwarded-For</code> header. Site owners should check for this header to correctly determine the location of the user based on client's IP address.</li>
<li><strong>As a site owner, how do I opt-out from content optimization?</strong><br>
Data compression proxy respects the standard <code>Cache-Control: no-transform</code> directive. Site owners can mark individual resources with this directive and the proxy will pass them through directly to the browser.</li>
</ul>
</section>
{{/partials.standard_multidevice_article}}