-
- All Implemented Interfaces:
public final class CompressionStrategy
This class is a settings container for Javalin's content compression.
It is used by the JavalinResponseWrapper to determine the encoding and parameters that should be used when compressing a response.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
CompressionStrategy.Companion
-
Field Summary
Fields Modifier and Type Field Description private final Brotli
brotli
private final Gzip
gzip
private Integer
minSizeForCompression
private List<String>
excludedMimeTypesFromCompression
-
Constructor Summary
Constructors Constructor Description CompressionStrategy(Brotli brotli, Gzip gzip)
-
Method Summary
Modifier and Type Method Description final Brotli
getBrotli()
final Gzip
getGzip()
final Integer
getMinSizeForCompression()
1500 is the size of a packet, compressing responses smaller than this serves no purpose final Unit
setMinSizeForCompression(Integer minSizeForCompression)
1500 is the size of a packet, compressing responses smaller than this serves no purpose final List<String>
getExcludedMimeTypesFromCompression()
Those mime types will be processed using NONE compression strategy final Unit
setExcludedMimeTypesFromCompression(List<String> excludedMimeTypesFromCompression)
Those mime types will be processed using NONE compression strategy -
-
Method Detail
-
getMinSizeForCompression
final Integer getMinSizeForCompression()
1500 is the size of a packet, compressing responses smaller than this serves no purpose
-
setMinSizeForCompression
final Unit setMinSizeForCompression(Integer minSizeForCompression)
1500 is the size of a packet, compressing responses smaller than this serves no purpose
-
getExcludedMimeTypesFromCompression
final List<String> getExcludedMimeTypesFromCompression()
Those mime types will be processed using NONE compression strategy
-
setExcludedMimeTypesFromCompression
final Unit setExcludedMimeTypesFromCompression(List<String> excludedMimeTypesFromCompression)
Those mime types will be processed using NONE compression strategy
-
-
-
-