Английская Википедия:Brotli
Шаблон:Short description Шаблон:About Шаблон:Infobox software
Brotli is a lossless data compression algorithm developed by Google. It uses a combination of the general-purpose LZ77 lossless compression algorithm, Huffman coding and 2nd-order context modelling. Brotli is primarily used by web servers and content delivery networks to compress HTTP content, making internet websites load faster. A successor to gzip, it is supported by all major web browsers and has become increasingly popular, as it provides better compression than gzip.
History
Google employees Jyrki Alakuijala and Zoltán Szabadka initially developed Brotli in 2013 to decrease the size of transmissions of WOFF web font.[1] Alakuijala and Szabadka completed the Brotli specification during 2013Шаблон:Ndash2016. The specification was accompanied with a reference implementation developed by two additional authors, Evgenii Kliuchnikov and Lode Vandevenne, who had previously developed Google's zopfli implementation of deflate and gzip compatible compression in 2013.[2]Шаблон:Rp 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]
The Brotli specification was generalized in September 2015 for HTTP stream compression (content-encoding type "br"). This generalized iteration also improved the compression ratio by using a predefined dictionary of frequently used words and phrases. 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, and more compression quality levels have been added. Additionally, the new release shows performance improvements across platforms, with decoding memory reduction.[3]
The Internet Engineering Task Force approved the Brotli compressed data format specification as an informational request for comment (Шаблон:IETF RFC) in July 2016.[4] The Brotli data format is an integral part of the 2nd iteration of the Web Open Font Format,[4]Шаблон:Rp which was recognized in a 2021 Technology & Engineering Emmy Award from the National Academy of Television Arts & Sciences for font technology standardization at W3C.[5][6]
Brotli support has been added over the years to web browsers, with 96% of worldwide users using a browser that supports the format, as of July 2022.[7]
In 2016 Dropbox reimplemented Brotli in Rust to fulfill their requirement to be more secure against a malicious client. In 2018 they implemented the missing feature so one can append to a Brotli compressed file.[8][9][10]
Algorithm
Brotli's new file format allows its authors to improve upon Deflate by 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.
Unlike most general-purpose compression algorithms, Brotli uses a predefined dictionary, roughly 120 KiB in size, in addition to the dynamically populated ("sliding window") dictionary. The predefined dictionary contains over 13000 common words, phrases and other substrings derived from a large corpus of text and HTML documents.[11][2] Using a predefined dictionary has been shown to increase compression where a file mostly contains commonly used words.[12] However, according to Alakuijala, the predefined dictionary does not distract from Brotli's general-ness, and is not the main reason for improved compression. Brotli with an all-zero dictionary still performs well on web content due to the algorithmic advances, he claims.[13]
Brotli's sliding window is limited to 16 MiB. This enables decoding on mobile phones with limited resources, but makes Brotli underperform on compression benchmarks having larger files. The constraints of the small window size can be alleviated by using Large Window Brotli, which is not compatible with RFC7932 (Brotli proper).[14]
Name
While Google's zopfli implementation of the deflate compression algorithm is named after Zöpfli, the Swiss German word for a snack-sized braided buttery bread, brotli is named after Brötli, the Swiss German word for a bread roll.[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,[4]Шаблон:Rp 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.[15] Other implementations of the specification also exist, including one in the source-to-source Haxe language.
Applications
Brotli compression is generally used as an alternative to gzip on the web, as Brotli provides better overall compression.[16] Compared to gzip compression, JavaScript files compressed with Brotli are roughly 15% smaller, HTML files are around 20% smaller, and CSS files are around 16% smaller.[17]
The reference implementation does ship a command-line program Шаблон:Code similar to Шаблон:Code,[18] but use in the Unix-like world as a simple compressor is scarce. Libarchive developers find the raw stream format of .br
files difficult to support, as there is no magic number to indicate the file format.[19]
Industry support
Browsers and other clients
- Mozilla Firefox introduced support for the "br" content-encoding method in version 44 (released on 26 January 2016).[20]
- Google Chrome has supported the "br" content-encoding method since version 50 (released on 20 April 2016).[21]
- Opera has supported the "br" content-encoding method since version 38 (released 8 June 2016).[21]
- Microsoft Edge has supported the "br" content-encoding method since version 15 (released on 5 April 2017).[22]
- Safari has supported the "br" content-encoding method since version 11 (released on 5 October 2017).
- cURL has a compile-time option to support the "br" content-encoding method using libbrotli as of version 7.57, released on 29 November 2017.[23]
- 7zip is available extended with Brotli by 7zip-zstd.[24]
- PeaZip supports Brotli .BR format for compression and extraction[25]
Web servers
- For Apache HTTP Server, the "br" content-encoding method has been supported by the mod_brotli module since version 2.4.26.[26]
- Microsoft IIS has a supported extension since May 2018 that adds support for the "br" content-encoding method.[27]
- Microsoft Azure Front Door can dynamically compress content on the edge using Brotli[28] since its launch on April 17, 2019.[29]
- nginx has a ngx_brotli module provided by Google since December 2016.
- Node.js features a built-in native en- and decoder since version 11.7.0, which can be used to support the "br" content-encoding.
- Amazon CloudFront can automatically compress cacheable responses at the edge using Brotli, as of September 2020.[30]
- LiteSpeed Web Server has included the "br" content-encoding method for static files only since version 5.2 in July 2017.
- Cloudflare CDN offers a brotli option to compress data between its edge node and the user.[31]
- NaviServer added support in version 4.99.17b1
- Caddy serves statically compressed .br files since version 0.9.4 from December 21st, 2016.
- lighttpd mod_deflate supports .br since 1.4.56[32] from November 2020.
References
- Notes
External links
- Brotli reference implementation at Шаблон:GitHub
- ↑ Шаблон:Citation.
- ↑ 2,0 2,1 Шаблон:Citation.
- ↑ 3,0 3,1 3,2 Шаблон:Citation.
- ↑ 4,0 4,1 4,2 Шаблон:Citation.
- ↑ Шаблон:Cite web
- ↑ Шаблон:Cite web
- ↑ Шаблон:Cite web
- ↑ Lossless compression with Brotli in Rust for a bit of Pied Piper on the backend, Daniel Reiter Horn and Mehant Baid, 2016-06-29.
- ↑ [1], Rishabh Jain and Daniel Reiter Horn, 2020-08-04
- ↑ append to brotli compressed file, github ticket to google Brotli, listing implementation ideas, 2017-12-06
- ↑ Шаблон:Citation.
- ↑ Шаблон:Cite book.
- ↑ Шаблон:Cite web
- ↑ Шаблон:Cite web
- ↑ Шаблон:Citation.
- ↑ Шаблон:Cite web
- ↑ Шаблон:Cite web
- ↑ Шаблон:Cite web
- ↑ Шаблон:Cite web
- ↑ Шаблон:Citation.
- ↑ 21,0 21,1 Шаблон:Citation.
- ↑ Шаблон:Citation
- ↑ Шаблон:Cite web
- ↑ Шаблон:Cite web
- ↑ Шаблон:Cite web
- ↑ Шаблон:Citation.
- ↑ Шаблон:Cite web
- ↑ Шаблон:Cite web
- ↑ Шаблон:Cite web
- ↑ Шаблон:Cite web
- ↑ Шаблон:Cite web
- ↑ Шаблон:Cite web