Wikipedia

Wikipedia

en.wikipedia.org

Jump to navigation Jump to search

This article is about the compression algorithm. For Brötli, the Swiss-German bread roll it is named after, see Bread roll § Europe.

Logo of the Brotli compression format.

Brotli is a data format specification[1] for data streams compressed with a specific combination of the general-purpose LZ77 lossless compression algorithm, Huffman coding and 2nd order context modelling. Brotli was initially developed to decrease the size of transmissions of WOFF2 web fonts, and in that context was a continuation of the development of zopfli, which is a zlib-compatible implementation of the standard gzip and deflate specifications. Brotli allows a denser packing than gzip and deflate because of several algorithmic and format level improvements: the use of context models for literals and copy distances, describing copy distances through past distances, use of move-to-front queue in entropy code selection, joint-entropy coding of literal and copy lengths, the use of graph algorithms in block splitting, and a larger backward reference window are example improvements. The Brotli specification was generalized in September 2015 for HTTP stream compression (content-encoding type 'br'), and can now be used to encode any data sent by a web server to a web browser if both client and server support the format. This generalized iteration also improved the compression ratio by using a pre-defined dictionary of frequently-used words and phrases.

The Brotli specification was developed in 2013–2016 by Google employees Jyrki Alakuijala and Zoltan Szabadka, and was accompanied by a reference implementation developed by the two authors of the specification together with Evgenii Kliuchnikov and Lode Vandevenne, who had previously developed Google's zopfli reimplementation of deflate/gzip compression formats in 2013.[2]:1 Unlike zopfli, which was a reimplementation of an existing data format specification, Brotli was a new data format, and allowed the authors to improve compression ratios even further.[3]

Brotli was designed for use on a sequentially-processed data stream (a bitstream),[1]:2 rather than on discrete random-access files. This makes Brotli particularly suitable for compressing data as it is sent over a network connection. Under ideal circumstances, this reduces the volume of data being transmitted. The transmission of a compressed stream may then also complete sooner than would be the case for an uncompressed stream, or a stream compressed with a less efficient stream compressor such as gzip or deflate. While gzip and deflate are comparatively light-weight compressors (i.e. less processor- and memory-intensive than Brotli), and are already widely supported by many web servers, Brotli has not yet been implemented as widely. The Brotli compressed data format was submitted to the Internet Engineering Task Force with a request for comment (RFC 7932) in July 2016.[1] The Brotli data format is an integral part of the 2nd iteration of the Web Open Font Format.[1]:3

While Google's zopfli implementation of the deflate compression algorithm is named after a Swiss German word for a braided sweet bread and literally means "little plait", brotli is a Swiss German word for a bread roll and literally means "small bread".[3] Google's own implementation of the Brotli specification was released under the terms of the permissive free software MIT license in 2016. A formal validation of the Brotli specification was independently implemented by Mark Adler,cf. [1]:126 one of the co-authors of the zlib/gzip compression format and library. Adler's implementation was released under the terms of the similarly permissive Apache license.[4] Other implementations of the specification also exist, including one in the source-to-source haxe language.

Contents

About

Brotli was first released in 2013 for off-line compression of web fonts.[5] The version of Brotli released in September 2015 by the Google software engineers contained enhancements in generic lossless data compression, with particular emphasis on use for HTTP compression. The encoder was partly rewritten, with the result that the compression ratio improved, both the encoder and the decoder have been sped up, the streaming API was improved, more compression quality levels have been added. Additionally, the new release shows performance improvements across platforms, with decoding memory reduction.[3]

Unlike most general purpose compression algorithms, Brotli uses a pre-defined 120 kilobyte dictionary, in addition to the dynamically populated ("sliding window") dictionary. The pre-defined dictionary contains over 13000 common words, phrases and other substrings derived from a large corpus of text and HTML documents.[6][2] Using a pre-defined dictionary has been shown to increase compression where a file mostly contains commonly-used words.[7]

Brotli is the best performing modern compressor when run on short data. Brotli can give more than ten times the compression speed while still compressing more densely than Zstandard. At highest density settings, Brotli compresses the web content benchmark 14% more densely (or 6% without the static dictionary) than Zstandard. [8]

Unlike other compression formats, Brotli's decoding memory use has been limited to 16 MB. This enables decoding on mobile phones with limited resources, but makes Brotli underperform on compression benchmarks having larger files. One can circumvent the decoding memory constraints by using the Large Window Brotli. Large Window Brotli is not compatible with RFC7932.

Streams compressed with Brotli have the content encoding type "br".

Industry support

Browser support

  • Google Chrome has supported the 'br' content-encoding method since version 50 (released on 20 April 2016).[9]
  • Microsoft Edge has supported the 'br' content-encoding method since version 15 (released on 5 April 2017).[10]
  • Mozilla Firefox introduced support for the 'br' content-encoding method in version 44 (released on 26 January 2016).[11]
  • Opera has supported the 'br' content-encoding method since version 38 (released 8 June 2016).[9]
  • Safari has supported the 'br' content-encoding method since version 11 (released on 5 October 2017).

Web server support

  • For Apache HTTP Server, the 'br' content-encoding method has been supported by the mod_brotli module since version 2.4.26.[12]
  • Microsoft IIS has a IIS brotli community extension since March 2016 that adds support for the 'br' content-encoding method.
  • nginx has a ngx_brotli module provided by Google since December 2016.
  • Node.js has a community module called shrink-ray that adds support for the 'br' content-encoding method.
  • LiteSpeed Web Server has included the 'br' content-encoding method for static files only since version 5.2 in July 2017.
  • OpenLiteSpeed first introduced the 'br' content-encoding method for static files only in version 1.4.27 as part of the web server.

Support in other software

  • cURL has supported the 'br' content-encoding method since version 7.57, released on 29 November 2017.[13]

References

- Finley, Klint (22 September 2015),

"Hooli, I Mean Google, Gives Away Compression Code for Free",

Wired Online, wired.com .

Source en.wikipedia.org

Report Page