Enable Text Compression in Servers

File sizes that are too large in server requests can wreak havoc on load time.

Text compression reduces the amount of bytes in network responses that include text content.

According to Google, when modern browsers solicit resources, it identifies text compression encodings the server uses in the accept-encoding request header. The server encodes the response in a format the browser supports and signals which format it used in the content-encoding response header.

Eliminating unnecessary text such as comments or white spaces can severely reduce text-based content by up to 70 percent.

How to enable this on your server

Google suggests using Brotli in your server to enable compression. Some browsers, however, still do not support Brotli, so, as a fallback, direct the server to enable GZIP compression. GZIP is more widely supported compressed data format. Do not use these compression encodings for things other than text-based content.

Loading...