我想在我的Springboot Rest API中实现Gzip响应压缩。
我在我的application.properties中使用以下配置:
# Enable response compression
server.compression.enabled=true
# The comma-separated list of mime types that should be compressed
server.compression.mime-types=text/html,text/xml,text/plain,text/css,text/javascript,application/javascript,application/json
# Compress the response only if the response size is at least 10KB
server.compression.min-response-size=10240
响应压缩正在进行中,但奇怪的是,它也会压缩大小只有1KB或500B的响应,而根据server.compression.min-response-size=10240
的设置,不应该这样。