Comments:"Data Compression Proxy - Google Chrome Mobile — Google Developers"
URL:https://developers.google.com/chrome/mobile/docs/data-compression
Faster, safer, and cheaper mobile web browsing with data compression in Chrome for Android
The latestChrome Beta for Android includes an experimental feature to reduce cellular data usage and speed up mobile web browsing, using proxy servers hosted at Google to optimize website content.
In our internal testing, this feature has been shown to reduce data usage by 50% and speed up page load times on cellular networks! To enable it, visit chrome://flags in your browser and select “Enable Data Compression Proxy”– easy as that.
Features and implementation
The core optimizations, which allow us to reduce overall data usage and speed up the page load times, are performed by Google servers. When the Data Compression Proxy feature is enabled, Chrome mobile opens a dedicated SPDY connection between your phone and one of the optimization servers running in Google’s datacenters and relays all HTTP requests over this connection.
The proxy server receives the request initiated on the mobile device, initiates a request for the required resource on your behalf, and then optimizes each asset before delivering it back to the client. The content optimization is performed by ouropen-source PageSpeed libraries, which are specifically tuned for theChrome for Android browser. The rendering of the page, and all JavaScript execution, is performed by the client’s browser.
Also, note that secure connections (HTTPS) are routed directly
from your mobile device to the destination,
bypassing the optimization proxy –
only HTTP requests are routed through and optimized by the proxy.
Further,
the use of the service does not require a Google account;
navigation in incognito tabs bypasses the proxy;
original IP address of your device is forwarded to the destination
via the X-Forwarded-For
header –
the data compression service is a transparent proxy.
Curious to see the bandwidth savings provided by the proxy? Easy, open a new tab on your device, head to chrome://net-internals, and click on Bandwidth. There, as the screenshot below illustrates, you will find a breakdown of the original data size vs. the optimized version that your browser received. The bandwidth savings add up quickly!
Let’s take a closer look at some of the specific optimizations enabled by the data compression proxy.
SPDY for speed
The connection from the mobile device to the proxy runs over SPDY, an optimized protocol for the Web that is supported by Chrome, Firefox and Opera, and is also the basis for the forthcoming HTTP/2.0 standard being developed in the IETF.
By using SPDY, 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. In fact, our studies show that just theuse of SPDY alone can reduce page load times by 23% on cellular networks, and this is before we have even talked about optimizing any of the content!
Further, there are many secondary benefits to using SPDY:
- 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.
- Less network activity and faster load times also mean that the mobile radio has to be active for shorter periods of time, which translates into longer battery life!
- The SPDY connection runs over SSL, which enables safer and more secure browsing.
Content optimization
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!
Transcoding images: 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 theWebP format, which requires fewer bytes than other popular formats, such as JPEG and PNG. The proxy supports the newWebP lossless format 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!
Content-aware compression: 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.
Safer, more secure browsing: The browser-to-proxy connection runs over SSL, meaning that your browsing session is encrypted between your device and Google’s servers. The proxy also implements Safe Browsing for Chrome for Android, by informing the browser when you attempt to visit a known malware or phishing site. This causes a warning interstitial page to be displayed, which you can click through if you wish to visit the site. This allows the list of harmful sites to be continuously updated on the proxy, without incurring the overhead of updating it over the air.
Building a faster mobile web
This is just the beginning of what a powerful proxy service can provide to make the mobile web experience a faster and a more enjoyable one, 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 — stay tuned for more.
In the meantime, please give it a try, and report your experience to us! Most importantly, if you run into any problems, please report a bug by visiting the Settings menu inChrome Beta for Android and tapping Report an Issue.
About the authors
Matt Welsh is the head of the Mobile Web Performance team at Google’s Seattle office.
Follow Matt on Google+.
Ilya Grigorik is a Developer Advocate on the Chrome team at Google in Mountain View.Follow Ilya on Google+.