# Enable Compression

> [!CAUTION]
> **Deprecated** . This page was written for version 4 of the PageSpeed Insights API, which is deprecated and will be shut down in May 2019. [Version 5](https://developers.google.com/speed/docs/insights/v5/get-started) is the latest and provides both real-world data from the Chrome User Experience Report and lab data from Lighthouse.

This rule triggers when PageSpeed Insights detects that compressible resources were served without `gzip` compression.

### Overview

All modern browsers support and automatically negotiate `gzip` compression for all HTTP requests. Enabling `gzip` compression can reduce the size of the transferred response by up to 90%, which can significantly reduce the amount of time to download the resource, reduce data usage for the client, and improve the time to first render of your pages. See [text compression with GZIP](https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/optimize-encoding-and-transfer#text-compression-with-gzip) to learn more.

### Recommendations

Enable and test gzip compression support on your web server. The HTML5 Boilerplate project contains [sample configuration files](https://github.com/h5bp/server-configs) for all the most popular servers with detailed comments for each configuration flag and setting: find your favorite server in the list, look for the `gzip` section, and confirm that your server is configured with recommended settings. Alternatively, consult the documentation for your web server on how to enable compression:

- Apache: Use [mod_deflate](http://httpd.apache.org/docs/current/mod/mod_deflate.html)
- Nginx: Use [ngx_http_gzip_module](http://nginx.org/en/docs/http/ngx_http_gzip_module.html)
- IIS: [Configure HTTP Compression](http://technet.microsoft.com/en-us/library/cc771003(v=WS.10).aspx)

## FAQ

PageSpeed Insights reports that many of my static content files need to be gzipped,
but I have configured my web server to serve these files using gzip compression.
Why is PageSpeed Insights not recognizing the compression?
:
    Proxy servers and anti-virus software can disable compression when files are downloaded to a
    client machine. PageSpeed Insights' results are based on headers that were actually returned
    to your client, so if you are running the analysis on a client machine that is using such
    anti-virus software, or that sits behind an intermediate proxy server (many proxies are
    transparent, and you may not even be aware of a proxy intervening between your client and
    web server), they may be the cause of this issue.


## Feedback

Was this page helpful?
<button class="button button-primary expand-control gc-analytics-event" data-category="Helpful" data-value="1" data-label="/speed/docs/insights/EnableCompression" style="background-color:#f44336;"> Yes </button>

> [!TIP]
> Great! Thank you for the feedback. If you have a specific, answerable question about using PageSpeed Insights, ask the question in English on [Stack
> Overflow](https://stackoverflow.com/questions/tagged/pagespeed-insights). For general questions, feedback, and discussion, start a thread in the [mailing list](https://groups.google.com/forum/#!forum/pagespeed-insights-discuss).

<button class="button button-primary expand-control gc-analytics-event" data-category="Helpful" data-value="0" data-label="/speed/docs/insights/EnableCompression" style="position:absolute;top:0;left:70px;background-color:#f44336;"> No </button>

> [!WARNING]
> Sorry to hear that. If you have a specific, answerable question about using PageSpeed Insights, ask the question in English on [Stack
> Overflow](https://stackoverflow.com/questions/tagged/pagespeed-insights). For general questions, feedback, and discussion, start a thread in the [mailing list](https://groups.google.com/forum/#!forum/pagespeed-insights-discuss).