# Chrome: This page isn’t working — sent an invalid response. ERR_CONTENT_DECODING_FAILED

**Code:** `ERR_CONTENT_DECODING_FAILED` · **Category:** Browser · **Seen on:** Chrome, Edge, PHP, Nginx, Apache

The response claims to be compressed (gzip/brotli) but cannot be decompressed — it was double-compressed, truncated or not compressed at all.

## Meaning

The `Content-Encoding` header and the real body must match. Double compression (the app gzips and the server gzips again), a proxy that decompresses but leaves the header, or PHP `zlib.output_compression` combined with `ob_gzhandler` all trigger it.

## Common causes

- Body compressed twice (application + web server or CDN)
- `Content-Encoding: gzip` header on an uncompressed body
- Truncated compressed stream (crash, proxy limit)
- Mixed `zlib.output_compression` and manual gzip in PHP
- Corrupted cache storing the wrong encoding

## Quick fix

1. Compress in exactly one layer
2. Check `curl -sI --compressed` and `curl -s -H "Accept-Encoding: gzip" | file -`
3. Purge CDN/cache after fixing

## Detailed fix by platform

### PHP

1. Use either `zlib.output_compression=On` or `ob_gzhandler`, not both
2. Ensure no output before `header()` calls

### Nginx

1. `gzip on;` should not be used together with an upstream that already sends `Content-Encoding: gzip` unless `gzip_proxied`/`proxy_set_header Accept-Encoding ""` is set deliberately

### Apache

1. Disable duplicate `mod_deflate` rules; check `.htaccess` `AddOutputFilterByType`

## How to diagnose

1. **Layers** — How many places compress?
2. **Test** — Does the body decompress with gunzip?
3. **Cache** — Is a stale encoding cached?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/browser/err-content-decoding-failed)
