WEB服务端gzip压缩

折月煮酒 提交于 2020-01-22 07:07:04

一、tomcat开启gzip压缩

Tomcat启用GZIP压缩,提升web性能
我用到的compressableMimeType:

text/html,text/xml,application/javascript,text/css,text/plain,application/json,application/x-font-woff,application/vnd.ms-fontobject,application/x-font-ttf,audio/mpeg,application/pdf,application/vnd.unity,text/octet-stream,application/octet-stream

注:
1、可以在tomcat conf/web.xml中查看mime type;
2、图片一般不能gzip压缩

二、nginx开启gzip压缩

前端性能优化之gzip
nginx gzip压缩

三、问题

httpclient访问网站时设置Accept-Encoding为gzip,deflate返回的结果为乱码的问题

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!