spring-boot启用gzip压缩测试

spring-boot启用gzip压缩提升数据接口的访问速度

一、添加配置
传输数据大于1KB时启用压缩

server:
  port: 7474
  servlet:
    context-path: /web
  compression:
    enabled: true
    min-response-size: 1024
    mime-types:
    - image/png
    - image/jpeg
    - image/jpg
    - text/html
    - application/javascript
    - text/css
    - application/octet-stream
    - application/json

spring:
  thymeleaf:
    cache: false
  mvc:
    static-path-pattern: /path/**
  resources:
    static-locations: classpath:/static/

二、接口测试
1、启用压缩之前
spring-boot启用gzip压缩测试_第1张图片
2、启用压缩之后
spring-boot启用gzip压缩测试_第2张图片
经过测试,启用gzip数据流压缩之后可以很有效的提升数据接口的访问效率!

你可能感兴趣的:(知识图谱,可视化)