Enable gzip compression with Nginx

As others have written, it’s not enough to enable gzip compression in your server — the client also needs to ask for it in its requests via the Accept-Encoding: gzip header (or a superset thereof). Modern browsers include this header automatically, but for curl you’ll need to include one of the following in your command:

  • -H "Accept-Encoding: gzip" : You should see the Content-Encoding: gzip header in the response (might need to output headers with curl’s -v flag), as well as some seemingly garbled output for the content, the actual gzip stream.
  • --compressed : You should still see Content-Encoding: gzip in the response headers, but curl knows to decompress the content before outputting it.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)