This rule is triggered when PageSpeed Insights detects that a compressed resource on a Web page is not provided with HTTP compression.

Overview

Many network servers can compress files into a file by calling a third-party module or using a built-in program gzipFormat, and then send the compressed file for download. This can save you some time when downloading the resources needed to render the website.

建议

您应在自己的网络服务器上启用压缩功能。以下这些参考展示了某些热门网络服务器上所启用的压缩功能:

 

Frequently Asked Questions

PageSpeed Insights reports that many static content files need to be compressed into gzip format, but I have configured my network server to provide these files in gzip compressed format. Why can't PageSpeed Insights recognize these compressed files?
在将文件下载到客户端计算机时,代理服务器和防病毒软件可以停用压缩功能。由于PageSpeed Insights是根据实际返回到客户端的标头来报告结果,因此,如果您要在使用此类防病毒软件或在后面放置中级代理服务器的客户端计算机上运行分析(许多代理服务器是透明的,您甚至可能意识不到代理服务器介入您的客户端和网络服务器),则可能会导致出现此问题。
要确定代理服务器是否为导致此问题的原因,您可以使用PageSpeed Insights Chrome ExtensionsTo check the header:
  1. Run PageSpeed on the related web page.
  2. 点击显示资源标签。
  3. Expand the URL of the resource marked uncompressed. The system displays the header displayed with the resource. If you see a file namedViaForwardedProxy-ConnectionIndicates that the proxy server has provided the resource.

Except as other written, the content of this page is licensed under theCreative Commons Attribution 3.0 License, and code samples are licensed under the Apache 2.0 License. For details, see our Site Policies.