Chrome starts testing compression using shared dictionaries, extremely effective for websites with many repeat visitors
Various types of data are compressed during communication between web servers and browsers. As algorithms with higher compression rates continue to be developed and popularized, Google has announced that it will begin testing compression using shared dictionaries in Chrome.
Supercharge compression efficiency with shared dictionaries | Blog | Chrome for Developers
In order to reduce resource loading time when viewing a website, it is common for the web server to compress common text format files such as HTML, CSS, and JavaScript before sending them, and then decompress them on the client.
For a long time, an algorithm called gzip was used for compression, but in 2016 Chrome introduced an algorithm called Brotli that achieves better compression rates, and Chrome 123 is scheduled to be released on March 19, 2024. A new algorithm called ZStandard is scheduled to be introduced, and improvements are being made.
In addition to improving the compression algorithm, the Chrome development team is currently developing a method that uses shared dictionaries to further increase the compression rate. I made it clear.
In the case of a compression method that does not use a shared dictionary, the amount of data is reduced by ``replacing the same data with data that indicates that part if it has appeared previously,'' as shown in the second ``function'' part in the figure below. I am.
When using a shared dictionary, by preparing frequently occurring parts as a dictionary in advance, it is possible to compress data from the beginning.
Algorithms such as Brotli originally have an internal dictionary, but the compression rate can be improved by using a shared dictionary that is customized according to the type of framework used by the website. As shown in the figure below, it can sometimes achieve a compression rate of up to 96% compared to Gzip.
In addition to reducing the HTML size on Google's search results pages to an average of 43%, it is said that it can significantly reduce the amount of data on various sites, such as reducing the size of HTML to an average of 30% on Amazon.
Chrome indicates support for shared dictionaries by displaying 'br-d' and 'zstd-d' in the 'Accept-Encoding' header of the request. The server is notified of which shared dictionary is available by writing a hash in the 'Available-Dictionary' header.
In addition to directly preparing a dictionary, the website can specify a static resource to be used as a dictionary using the 'Use-As-Dictionary' header. For example, by setting as shown in the figure below, when updating from 'styles.v1.css' to 'styles.v2.css', it is OK to send almost only the difference data.
Due to the nature of this mechanism, it is effective in improving loading performance for sites with a high rate of repeat visitors and frequent updates. To enable the use of the shared dictionary on the Chrome side, access 'chrome://flags/#enable-compression-dictionary-transport' and set the 'Compression dictionary transport' flag to 'Enabled'.
If you want to try the shared dictionary on the website, you will be prompted to register for the Origin Trial .
Related Posts:
in Software, Posted by log1d_ts