aluksidadi
aluksidadi

Reputation: 483

Make nginx gzip only if asked

It seems like once gzip is turned on, it will only gzip even if the request doesnt set Accept-Encoding: gzip in the header.

Is there anyway so that if the request doesnt set Accept-Encoding, it will not return gzip?

Thanks!

Upvotes: 1

Views: 1618

Answers (1)

lsowen
lsowen

Reputation: 3828

Try viewing the headers with curl -I http://example.com/ (where example.com is replaced with your site). Verify that Content-Encoding: gzip isn't in the resulting headers.

Often other test clients add headers (including Accept-Encoding) automatically, which can make testing problematic.

Side note: If you are interested in verifying that the server does return gzip encoding when requested, you can use the alternate test query 'curl -I --compressed http://example.com/`.

Upvotes: 2

Related Questions