tokers / zstd-nginx-module

Nginx modules for the Zstandard compression
BSD 2-Clause "Simplified" License
196 stars 23 forks source link

requests with "Content-Type: application/json" can't get zstd compressed #17

Closed AlPasser closed 1 year ago

AlPasser commented 1 year ago

When I: curl ip:port/health_check/check -H 'Accept-Encoding: zstd' -v I got the response:

< HTTP/1.1 200 OK < Server: nginx < Content-Type: text/html; charset=utf-8 < Transfer-Encoding: chunked < Connection: keep-alive < Content-Encoding: zstd <

But if I (-H "Content-Type: application/json" added): curl ip:port/health_check/check -H 'Accept-Encoding: zstd' -H "Content-Type: application/json" -v I got:

< HTTP/1.1 200 OK < Server: nginx < Content-Type: application/json < Content-Length: 1183 < Connection: keep-alive <

The response body was not compressed with zstd Confused...

tokers commented 1 year ago

@AlPasser See https://github.com/tokers/zstd-nginx-module#zstd_types.

AlPasser commented 1 year ago

Oh, thx! Just like gzip conf, I should read the README carefully.