Smile 笑容

SDCH(Shared Dictionary Compression over HTTP) on google Chrome

在Google的浏览器 Chrome中 Accept-Encoding 值是 gzip,deflate,bzip2,sdch 我们发现它除了支持传统的 gzip和deflate压缩外,还提供了bzip2(压缩率要更高一些)和sdch 两个编码选项。



bout SDCH

New compression techniques in the latest version of the Google Toolbar use Shared Dictionary Compression over HTTP (SDCH) to speed up search results. When SDCH is enabled, you may see the following headers in your HTTP traffic:

Browser request:
Accept-Encoding: sdch, gzip
Avail-Dictionary: R2bxhrov
X-SDCH: Google 1.0.919.1957

Server response:
Content-Encoding: sdch, gzip
X-SDCH-Dictionary: Zu9moukL

To learn more about SDCH, see the SDCH Google Group or read the white paper. Please note that both resources are currently only available in English.

Disabling SDCH

If you'd like to disable this feature, follow these steps:

  1. Open a new Internet Explorer window.
  2. Click the Tools menu.
  3. Select Manage Add-ons.
  4. In the 'Manage Add-ons' window, select the Google Dictionary Compression sdch add-on.
  5. Click the 'Disable' radio button.
  6. Click the OK button.


Related Technologies and Background

In order to reduce payload size, HTTP/1.1 supports response compression via the Accept-Encoding and Content-Encoding headers. The most commonly used HTTP response compression encoding is gzip, which compresses data that is repeated within a given response. However, HTTP/1.1 does not provide a mechanism for compressing data that is repeated between responses. A different class of encoding technique, known as delta encoding, has proven effective at compressing inter-response data. Previous efforts to extend HTTP/1.1 to support delta compression have focused on encoding an HTTP response as a delta of a previous version of that response. One such approach is discussed in RFC 3229 "Delta encoding in HTTP" [RFC3229]. While RFC 3229 is effective at reducing payload size for many types of resources, it may not be suitable for certain classes of responses.

Specifically, under RFC 3229, deltas can only be applied to responses originating from the same URL, and the means of identifying the instance to delta "from" is by a Last-Modified timestamp or entity-tag. This makes RFC 3229 unsuitable for compressing dynamically generated responses to a given URL with varying query parameters (e.g. a search results page), since these types of responses are difficult to identify uniquely using entity tags or last modified timestamps. Content hashes can be used, but false positives are possible.

Also, storing all previous responses on the server may not be practical.

摘自 Google Dictionary Compression sdch white paper, 该白皮书在 可以查看到。