如题所述
第1个回答 2016-09-06
nginx.conf
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip http_version 1.0;
gzip_comp_level 2;
gzip_types text/plain application/json;
gzip_vary on;
gzip_proxied expired no-cache no-store private auth;
我用的是web.py框架
web.header("Content-Type", "application/json")
web.header("Content-Encoding", "gzip")
curl -I返回的是
HTTP/1.1 200 OK
Server: nginx
Date: Tue, 27 Jan 2015 05:32:34 GMT
Content-Type: application/json
Connection: keep-alive
Content-Encoding: gzip
Set-Cookie: webpy_session_id=0b019c20c14f05cd3db73afe18ca07902928889d; Path=/; httponly
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip http_version 1.0;
gzip_comp_level 2;
gzip_types text/plain application/json;
gzip_vary on;
gzip_proxied expired no-cache no-store private auth;
我用的是web.py框架
web.header("Content-Type", "application/json")
web.header("Content-Encoding", "gzip")
curl -I返回的是
HTTP/1.1 200 OK
Server: nginx
Date: Tue, 27 Jan 2015 05:32:34 GMT
Content-Type: application/json
Connection: keep-alive
Content-Encoding: gzip
Set-Cookie: webpy_session_id=0b019c20c14f05cd3db73afe18ca07902928889d; Path=/; httponly