欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

tomcat和nginx gzip压缩 博客分类: tomcatnginxgzip tomcatnginxgzip 

程序员文章站 2024-03-22 19:56:04
...
<!--StartFragment -->
tomcat下gzip:
gzip在tomcat7下,如果要压缩js,需要在tomcat conf server.xml 除了要添加
compression="on"
还要添加

tomcat和nginx gzip压缩
            
    
    博客分类: tomcatnginxgzip tomcatnginxgzip 
 
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;

client_max_body_size 100m;
server_tokens off;
 
  • tomcat和nginx gzip压缩
            
    
    博客分类: tomcatnginxgzip tomcatnginxgzip 
  • 大小: 5.2 KB
相关标签: tomcat nginx gzip