服务器端配置gzip压缩,节省网络带宽,加速页面加载速度

 

Tomcat : server.xml

    

 

HAProxy : /etc/haproxy/haproxy.cfg

 

defaults
    mode                    http
    log                     global
    option                  httplog
    option                  dontlognull
    option http-server-close
    option forwardfor       except 127.0.0.0/8
    option originalto
    option httpclose
    option                  redispatch
    retries                 3
    timeout http-request    10s
    timeout queue           1m
    timeout connect         10s
    timeout client          1m
    timeout server          1m
    timeout http-keep-alive 10s
    timeout check           10s
    maxconn                 3000

    compression algo gzip
    compression type text/html text/plain text/css application/javascript application/json application/xml 

 

 问题总结:

1. HAProxy 配置的 application/json 导致HttpClient发送Post请求一直等待,无任何响应! 具体原因未知!

 

你可能感兴趣的:(网站优化)