Gzip 不工作?
Gzip not working?
虽然看起来很简单,但它不是工作事件...我不确定如何调试。请帮忙?
<Connector port="443" protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" KeystoreFile="/home/ec2-user/.keystore" KeystorePass="foobar" allowTrace="true" compression="on" compressableMimeType="text/html,text/xml,text/json,text/javascript,text/css,text/plain,
application/javascript,application/xml,application/xml+xhtml"/>
尝试设置属性 useSendfile="false"
如此处所述:https://tomcat.apache.org/tomcat-8.0-doc/config/http.html
compression
... Note: There is a tradeoff between using compression
(saving your bandwidth) and using the sendfile feature (saving your
CPU cycles). If the connector supports the sendfile feature, e.g. the
NIO connector, using sendfile will take precedence over compression.
... You can turn off sendfile by setting useSendfile
attribute of
the connector, ...
useSendfile
(bool
) Use this attribute to enable or disable
sendfile capability. The default value is true
. Note that the use
of sendfile will disable any compression that Tomcat may otherwise
have performed on the response.
虽然看起来很简单,但它不是工作事件...我不确定如何调试。请帮忙?
<Connector port="443" protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" KeystoreFile="/home/ec2-user/.keystore" KeystorePass="foobar" allowTrace="true" compression="on" compressableMimeType="text/html,text/xml,text/json,text/javascript,text/css,text/plain,
application/javascript,application/xml,application/xml+xhtml"/>
尝试设置属性 useSendfile="false"
如此处所述:https://tomcat.apache.org/tomcat-8.0-doc/config/http.html
compression
... Note: There is a tradeoff between using compression (saving your bandwidth) and using the sendfile feature (saving your CPU cycles). If the connector supports the sendfile feature, e.g. the NIO connector, using sendfile will take precedence over compression. ... You can turn off sendfile by settinguseSendfile
attribute of the connector, ...
useSendfile
(bool
) Use this attribute to enable or disable sendfile capability. The default value istrue
. Note that the use of sendfile will disable any compression that Tomcat may otherwise have performed on the response.