tomcat和nginx gzip压缩 博客分类: tomcatnginxgzip tomcatnginxgzip
程序员文章站
2024-03-22 19:55:34
...
<!--StartFragment -->
client_max_body_size 100m;
tomcat下gzip:
gzip在tomcat7下,如果要压缩js,需要在tomcat conf server.xml 除了要添加
compression="on"
还要添加
compressableMimeType="text/html,text/xml,text/plain,text/css,application/javascript"
compression="on"
还要添加
compressableMimeType="text/html,text/xml,text/plain,text/css,application/javascript"
tomcat8不需要添加下面的compressableMimeType
nginx下gzip:
在conf下nginx.conf文件下
#压缩
gzip on;
gzip_types text/plain text/css text/xml application/javascript;
gzip on;
gzip_types text/plain text/css text/xml application/javascript;
client_max_body_size 100m;
server_tokens off;