Brotli
Original author(s) | Jyrki Alakuijala, Zoltán Szabadka |
---|---|
Developer(s) | Jyrki Alakuijala, Eugene Kliuchnikov, Robert Obryk, Zoltán Szabadka, Lode Vandevenne, Mislav Bradač |
Initial release | 15 October 2013 |
Stable release | 1.0.9
/ 27 August 2020[1] |
Repository | |
Written in | C |
Operating system | Cross-platform |
Platform | Portable |
Type | Data compression |
License | MIT License |
Website | github |
Brotli is a data format specification[2] for data streams compressed with a specific combination of the general-purpose LZ77 lossless compression algorithm, Huffman coding and 2nd order context modelling. Brotli is a compression algorithm developed by Google and works best for text compression. 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 is becoming increasingly popular, as it provides better compression than gzip.
History[]
Google employees and Zoltán Szabadka initially developed Brotli in 2013 to decrease the size of transmissions of WOFF web font. Alakuijala and Szabadka completed the Brotli specification during 2013–2016. 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.[3]: 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.[4] The Brotli specification was generalized in September 2015 for HTTP stream compression (content-encoding type 'br').
The Internet Engineering Task Force approved the Brotli compressed data format specification as an informational request for comment (RFC 7932) in July 2016.[2] The Brotli data format is an integral part of the 2nd iteration of the Web Open Font Format.[2]: 3
Brotli support has been added over the years to web browsers, with 94% of worldwide users using a browser that supports the format, as of March 2021.[5]
About[]
Brotli was first released in 2013 for off-line compression of web fonts.[6] Brotli 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'). This generalized iteration also improved the compression ratio by using a pre-defined 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.[4]
Unlike most general purpose compression algorithms, Brotli uses a pre-defined dictionary, roughly 120 KiB in size, 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.[7][3] Using a pre-defined dictionary has been shown to increase compression where a file mostly contains commonly used words.[8]
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).
Streams compressed with Brotli have the content encoding type "br".
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.[4] 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. [2]: 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.[9] Other implementations of the specification also exist, including one in the source-to-source haxe language.
Brotli is available as a port for Android in a terminal-interface with its own shared library.[10]
Brotli compression is generally used as an alternative to gzip, as Brotli provides better overall compression.[11] 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.[12]
Industry support[]
Browsers and other clients[]
- Mozilla Firefox introduced support for the 'br' content-encoding method in version 44 (released on 26 January 2016).[13]
- Google Chrome has supported the 'br' content-encoding method since version 50 (released on 20 April 2016).[14]
- Opera has supported the 'br' content-encoding method since version 38 (released 8 June 2016).[14]
- Microsoft Edge has supported the 'br' content-encoding method since version 15 (released on 5 April 2017).[15]
- 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.[16]
- 7zip is available extended with Brotli by 7zip-zstd. [17]
- PeaZip supports Brotli .BR format for compression and extraction [18]
Web servers[]
- For Apache HTTP Server, the 'br' content-encoding method has been supported by the mod_brotli module since version 2.4.26.[19]
- Microsoft IIS has a [1] supported extension since May 2018 that adds support for the 'br' content-encoding method.
- Microsoft Azure Front Door can dynamically compress content on the edge using Brotli[20] since its launch on April 17, 2019[21].
- 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.[22]
- 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.[23]
- NaviServer added support in version 4.99.17b1
- Caddy (web server) Serves statically compressed .br files since version 0.9.4 from December 21st, 2016.
- lighttpd mod_deflate supports .br since 1.4.56[24] from November 2020.
References[]
- ^ "Releases - google/brotli". Retrieved 13 September 2020 – via GitHub.
- ^ a b c d Alakuijala, Jyrki; Szabadka, Zoltan (2016), RFC 7932: Brotli Compressed Data Format, Internet Engineering Task Force Request for Comments, Fremont, CA: IETF Trust.
- ^ a b Alakuijala, Jyrki; Kliuchnikov, Evgenii; Szabadka, Zoltan; Vandevenne, Lode (22 September 2015), "Comparison of Brotli, Deflate, Zopfli, LZMA, LZHAM and Bzip2 Compression Algorithms" (PDF), The Comprehensive R Archive Network, r-project.org.
- ^ a b c Szabadka, Zoltan (September 22, 2015), "Introducing Brotli: a new compression algorithm for the internet", Google Open Source Blog, Mountain View, CA: opensource.googleblog.com.
- ^ "Can I use... - Brotli". 2021-03-07.
- ^ Sheeter, Rod (February 18, 2015), "Smaller Fonts with WOFF 2.0 and unicode-range", Google Open Source Blog, Mountain View, CA: opensource.googleblog.com
- ^ Chirgwin, Richard (September 23, 2015), "Google's new squeeze: Brotli compression open-sourced", The Register, theregister.co.uk.
- ^ Larkin, Henry (2007). "Word Indexing for Mobile Device Data Representations". 7th IEEE International Conference on Computer and Information Technology (CIT 2007). pp. 399–404. doi:10.1109/CIT.2007.22. ISBN 978-0-7695-2983-7. S2CID 8707991..
- ^ Adler, Mark (Jan 26, 2015), "Brotli specification review and verification", Adler brotli, San Francisco: GitHub.
- ^ "Brotli as a standalone program for Android". Master-Console(Github).
- ^ Calvano, Paul (2018-07-25). "Brotli Compression: How Much Will It Reduce Your Content?". Retrieved 2021-03-07.
- ^ Pandjarov, Hristo (2021-01-13). "More Site Speed Gains with Brotli Compression Algorithm". SiteGround. Retrieved 2021-03-07.
- ^ Goodger, Ben; et al. (26 January 2016), "Firefox 44 release notes", Mozilla Firefox, Mozilla Foundation.
- ^ a b Baheux, Kenji (15 January 2016), "Accept-encoding: br on HTTPS connection", Chrome Platform Status, chromestatus.com.
- ^ Trace, Rob (December 20, 2016), "Introducing Brotli compression in Microsoft Edge", Microft Edge Developer, blogs.windows.com
- ^ Stenberg, Daniel; et al. "curl - Changes". curl.haxx.se. Retrieved 14 January 2018.
- ^ "README". 15 October 2021.
- ^ "Google Brotli: How to compress, open, extract BR files".
- ^ "Changes with Apache 2.4.26", Apache HTTPD repository, svn.apache.org.
- ^ "Caching with Azure Front Door". docs.microsoft.com.
- ^ "Azure Front Door Service is now available". azure.microsoft.com.
- ^ "Amazon CloudFront announces support for Brotli compression". aws.amazon.com.
- ^ "What will Cloudflare compress?". support.cloudflare.com.
- ^ "lighttpd 1.4.56 release info". redmine.lighttpd.net.
- Notes
- - Finley, Klint (22 September 2015), "Hooli, I Mean Google, Gives Away Compression Code for Free", Wired Online, wired.com.
External links[]
- Free computer libraries
- Lossless compression algorithms