# 超时时间
spring:
cloud:
openfeign:
client:
config:
# 全局设置
default:
# 连接时间
connectTimeout: 1
# 读取时间
readTimeout: 1
# 请求压缩
由于 OkHttpClient 使用“透明”压缩,如果存在content-encoding或标头,则禁用该压缩,因此当存在于类路径中并设置为accept-encoding时,我们不会启用压缩。 feign.okhttp.OkHttpClientspring.cloud.openfeign.okhttp.enabledtrue
spring:
cloud:
openfeign:
compression:
# 请求压缩
request:
enabled: true
# 响应压缩
response:
enabled: true
web 压缩设置
Feign 对什么类型压缩
spring:
cloud:
openfeign:
client:
compression:
# 请求压缩
request:
enabled: true
# 最小请求,超过了2048才进行压缩
min-request-size: 2048
# 增加压缩的请求的的格式
mime-types: text/xml,application/xml,application/json
← 介绍 OpenFeign局部配置 →