Skip to content

Commit fded0d2

Browse files
author
WeiziPlus
committed
1.1.1.5 nginx压缩json
1 parent 2edb669 commit fded0d2

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

doc/nginx配置

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ http {
3030
gzip_comp_level 2;
3131
gzip_proxied any;
3232
#需要压缩的MIME类型文件(图片不建议压缩)
33-
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript;
33+
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/json;
3434

3535
server {
3636
#监听80和443端口

springboot/demo-pc/src/main/resources/application.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
#############################################通用配置#############################################
2+
#开启gzip
3+
server:
4+
compression:
5+
enabled: true
6+
#压缩json
7+
mime-types: application/json,application/xml,text/html,text/xml,text/plain
8+
#需要压缩的最小值
9+
min-response-size: 2048
210
spring:
311
profiles:
412
#启动什么配置

springboot/demo-web/src/main/resources/application.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
#############################################通用配置#############################################
2+
#开启gzip
3+
server:
4+
compression:
5+
enabled: true
6+
#压缩json
7+
mime-types: application/json,application/xml,text/html,text/xml,text/plain
8+
#需要压缩的最小值
9+
min-response-size: 2048
210
spring:
311
profiles:
412
#启动什么配置

0 commit comments

Comments
 (0)