GZIP to compute the potential savings.
If the original size of a response is less than 1.4KiB, or if the potential compression savings is less than 10% of the original size, then Lighthouse does not flag that response in the results.
The potential savings that Lighthouse lists are the potential savings when the response is encoded with GZIP. If Brotli is used, even more savings are possible.
Enable text compression on the server(s) that served these responses in order to pass this audit.
When a browser requests a resource, it will use the Accept-Encoding
HTTP request header to indicate what compression algorithms it supports.
Accept-Encoding: gzip, compress, br
If the browser supports Brotli (br
) you should use Brotli because it can reduce the file size of the resources more than the other compression algorithms. Search for how to enable Brotli compression in <X>
, where <X>
is the name of your server. As of June 2020 Brotli is supported in all major browsers except Internet Explorer, desktop Safari, and Safari on iOS. See Browser compatibility for updates.
Use GZIP as a fallback to Brotli. GZIP is supported in all major browsers, but is less efficient than Brotli. See Server Configs for examples.
Your server should return the Content-Encoding
HTTP response header to indicate what compression algorithm it used.
Content-Encoding: br
To check if a server compressed a response:
Control+Shift+J
(or Command+Option+J
on Mac) to open DevTools.content-encoding
header in the Response Headers section.content-encoding
response header.To compare the compressed and de-compressed sizes of a response:
Control+Shift+J
(or Command+Option+J
on Mac) to open DevTools.See also Minify and compress network payloads.
Enable the Gzip Page Compression setting (System > Global configuration > Server).
Enable text compression in your web server configuration.