6 Nisan 2023 Perşembe

SpringBoot application.properties Compression Ayarları

server.compression.min-response-size Alanı
Örnek
Şöyle yaparız. Cevap 2048 byte'tan büyükse sıkıştırılır
server.compression.enabled=true
server.compression.min-response-size=2048
server.compression.mime-types Alanı
Örnek
Açıklaması şöyle
GZip compression is disabled by default in Spring Boot.
...
Note that, GZip compression has a small overhead. Therefore I’ve added a min-response-size property to tell spring boot server to compress the response only if the size is more than the given value.
Şöyle yaparız
# 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 1KB
server.compression.min-response-size=1024
server.compression.servlet-path-patterns Alanı
Sadece belirtilen path'e gelen istekleri sıkıştırır
Örnek
Şöyle yaparız
server.compression.mime-types=text/html,text/xml,text/plain,text/css,\
  application/json,application/javascript
server.compression.servlet-path-patterns=/*

Hiç yorum yok:

Yorum Gönder