Text compression is like squeezing a sponge to remove excess water. Just as squeezing a sponge reduces the amount of water it contains, text compression reduces the size of text-based resources on your website.
There are several, commonly used text compression algorithms, the most common of which is gzip.
Gzip compression works by finding repeated patterns in the text data and replacing them with shorter codes, which can be easily expanded back to their original form by the browser.
Gzip is the most widely used compression algorithm and is supported by virtually all modern web browsers and servers. However, we would strongly recommend testing different compression algorithms and settings to find the optimal solution for your website and/or CMS.
Brotli Text Compression
Brotli is a newer compression algorithm developed by Google that is designed to be more efficient than gzip. Brotli can achieve higher compression ratios than gzip, resulting in even smaller file sizes and faster page load times.
Learn more: How to Implement Brotli Text Compression
Zopfli Text Compression
Zopfli uses the same compression method as gzip but applies it more aggressively. This results in smaller file sizes and faster page speed and is particularly useful for compressing large files.
Deflate Text Compression
Deflate is an older compression algorithm that is still used on some older web servers. Deflate is less efficient than gzip and Brotli, but it can still provide some compression benefits.
LZMA Text Compression
Snappy Text Compression
Snappy is a compression algorithm developed by Google that is designed to be very fast. Snappy can compress and decompress data more quickly than gzip and Brotli but typically achieves lower compression ratios.
In this series:
In this series: