Table of contents of the article:
Technological innovation never stops, and a recent development in the world of web browsers promises to revolutionize the way we interact with the Internet. Google Chrome, the most used browser in the world, has introduced support for Zstandard (zstd), a data compression algorithm developed by Yann Collet of Meta (formerly Facebook). This move could mark a significant step forward in improving web page loading speeds and reducing bandwidth usage.
The latest versions of Chromium-based browsers now support Zstandard compression by default. This means that all your websites using @caddyserver or FrankenPHP are served using this state-of-the-art compression format for users of Chrome, Edge, and Opera 🎉. pic.twitter.com/YhWfh1oHw1
— Kévin Dunglas (@dunglas) April 15, 2024
What is Zstandard or ZSTD?
Zstandard is a lossless data compression algorithm originally developed by Yann Collet while working for Facebook. First launched on August 31, 2016, Zstandard was designed to offer a compression ratio comparable to that of the DEFLATE algorithm, used in the original 1991 ZIP and gzip programs, but with higher speed, especially during decompression. The algorithm is known for its ability to be adapted to different compression levels, from -7 (the fastest) to 22 (the slowest in compression but the best in terms of compression ratio).
One of Zstandard's distinguishing features is its ability to implement long-distance search and deduplication, similar to that offered by rzip or lrzip, starting from version 1.3.2. Additionally, it offers an “adaptive” mode that varies the level of compression based on I/O conditions, primarily how fast it can write output.
We have already discussed Zstandard in this post (ZStandard, the standard Facebook compression that is not so standard.) having in fact become the standard way for compressing backups in our company, which allows us to obtain, for example, an average saving of 50% in the storage of MySQL backups.
Implementation in Google Chrome
Last March 2024, Google added support for Zstandard in Chrome version 123, allowing this algorithm to be used in the HTTP Content-Encoding header. This implementation allows for more efficient data compression, which results in web pages that load faster, use less bandwidth, require less time, less CPU and less compression time for servers, thus also reducing costs operational.
Despite the great enthusiasm that greeted the introduction of Zstandard, currently support at the web server level remains rather limited. This landscape may soon change with the release of Zstd 1.5.6, an updated version that not only introduces new features specifically designed to improve the management of incremental updates in browsers, but also extends support to a wider variety of hardware architectures, such as SPARC64, ARM64EC and RISC-V. These improvements are designed to stimulate broader adoption of Zstandard by browsers and software in general, increasing its applicability and effectiveness in processing web data.
It is important to underline that, in the current technological landscape, talking about Chrome predominantly means referring to Chromium. Chromium is an open-source web browser project from which Google Chrome draws its source code. This platform is the basis not only for Google Chrome, but also for a number of other significant browsers. These include Microsoft Edge, Opera and Brave, which are developed using the same rendering engine as Chromium. As a result, the integration of Zstandard into Chromium means that this compression functionality will also be adopted and implemented in these other browsers in their upcoming updates.
Advantages over Brotli
Before the advent of Zstandard, Brotli was one of the favorite compression algorithms for managing web traffic, praised for its effectiveness in reducing the size of transmitted data and improving web page loading times. Brotli, developed by Google, was introduced in 2015 and has since become a standard for HTTP compression, thanks largely to its ability to achieve a good balance between compression speed and compression ratio, making it particularly useful for the web.
However, with the introduction of Zstandard, new advantages have emerged that could tip the scales in its favor in many usage scenarios. Zstandard offers significantly greater flexibility and decompression speed that generally exceeds that of Brotli, two factors crucial to the performance of the modern web.
Technical advantages of Zstandard over Brotli
- Decompression speed: Zstandard is designed to decompress data at very high speeds, regardless of the compression level used. This is especially beneficial for web applications that need fast loading times. While Brotli offers excellent compression, its decompression speed can be up to three times slower than Zstandard for the same compression ratio. For example, benchmark tests show that while Zstandard can decompress data at speeds exceeding 1000 MB/s on modern hardware, Brotli often falls short of 400 MB/s.
- Flexibility: Zstandard supports a very wide range of compression levels, from very fast to very powerful. This allows developers to choose the best balance between speed and efficiency depending on the specific needs of their application or network environment. Brotli, while highly configurable, offers less granularity in compression levels, which can limit its applicability in scenarios where customization is key.
- Efficiency under variable network conditions: Zstandard works exceptionally well in a variety of network conditions, maintaining its efficiency even when bandwidth is limited or latency is high. This makes it ideal for mobile environments or for users accessing web content from regions with less developed network infrastructures.
- Adaptability and supporting technologies: Zstandard includes features such as dictionary compression and a training mode that can further improve the compression ratio for specific datasets. This can be particularly useful for applications such as databases, system logs, and file transfers that have many redundancies. Brotli also supports dictionary-based compression, but Zstandard's training technology is more advanced, offering better performance especially with small file sizes.
Impact on Hosting services and Existing Systems
The introduction of Zstandard as a compression algorithm supported by Chrome presents a significant opportunity for system engineers and hosting providers. These professionals must now evaluate how their systems can be optimized to make the most of Zstandard's capabilities, while ensuring compatibility with browsers that do not yet support this algorithm.
One of the crucial aspects concerns updating the servers to support the new encoding. This step may require initial investments in time and resources, but it is essential to maintaining competitiveness in the hosting market. With the increased decompression speeds and flexibility offered by Zstandard, hosting services that adopt this technology early can deliver dramatically improved user experiences, resulting in faster page load times and more efficient use of bandwidth.
Furthermore, hosting services aiming to position themselves as leaders in the web performance industry will inevitably need to support Zstandard compression in addition to Brotli. This is not just a question of offering a new technology but becomes a distinctive element of technical superiority and ability to adapt to the modern needs of speed and efficiency of the Internet.
As regards our company, which has always been focused on research and development, while awaiting the stable production of Chrome and the browsers developed on top of Chromium, we have decided in our Roadmap to deliver by September 2024 , our entire web software stack is ZSTD compatible, starting from NGINX up to Varnish, guaranteeing an optimal testing time in these 4 months, as well as the relevant benchmarks, in order to offer, as always, the best enterprise-level hosting both for generic hosting and for specific hosting such as WordPress Hosting for example.