public class GzipHandlerFactory extends Object
Name | Default | Description |
enabled |
true | If true, all requests with `gzip` or `deflate` in the `Accept-Encoding` header will have their response entities compressed and requests with `gzip` or `deflate` in the `Content-Encoding` header will have their request entities decompressed. |
minimumEntitySize |
256 bytes | All response entities under this size are not compressed. |
bufferSize |
8KiB | The size of the buffer to use when compressing. |
excludedUserAgentPatterns |
(none) | The set of user agent patterns to exclude from compression. |
compressedMimeTypes |
(Jetty's default) | The list of mime types to compress. The default is all types apart the commonly known image, video, audio and compressed types. |
includedMethods |
(Jetty's default) | The list list of HTTP methods to compress. The default is to compress only GET responses. |
deflateCompressionLevel |
-1 | The compression level used for ZLIB deflation(compression). |
gzipCompatibleInflation |
true | If true, then ZLIB inflation(decompression) will be performed in the GZIP-compatible mode. |
Constructor and Description |
---|
GzipHandlerFactory() |
Modifier and Type | Method and Description |
---|---|
BiDiGzipHandler |
build(org.eclipse.jetty.server.Handler handler) |
io.dropwizard.util.Size |
getBufferSize() |
Set<String> |
getCompressedMimeTypes() |
int |
getDeflateCompressionLevel() |
Set<String> |
getExcludedUserAgentPatterns() |
Set<String> |
getIncludedMethods() |
io.dropwizard.util.Size |
getMinimumEntitySize() |
boolean |
isEnabled() |
boolean |
isGzipCompatibleInflation() |
boolean |
isSyncFlush() |
void |
setBufferSize(io.dropwizard.util.Size size) |
void |
setCompressedMimeTypes(Set<String> mimeTypes) |
void |
setDeflateCompressionLevel(int level) |
void |
setEnabled(boolean enabled) |
void |
setExcludedUserAgentPatterns(Set<String> excludedUserAgentPatterns) |
void |
setGzipCompatibleInflation(boolean gzipCompatibleInflation) |
void |
setIncludedMethods(Set<String> methods) |
void |
setMinimumEntitySize(io.dropwizard.util.Size size) |
void |
setSyncFlush(boolean syncFlush) |
public boolean isEnabled()
public void setEnabled(boolean enabled)
public io.dropwizard.util.Size getMinimumEntitySize()
public void setMinimumEntitySize(io.dropwizard.util.Size size)
public io.dropwizard.util.Size getBufferSize()
public void setBufferSize(io.dropwizard.util.Size size)
public int getDeflateCompressionLevel()
public void setDeflateCompressionLevel(int level)
public boolean isGzipCompatibleInflation()
public void setGzipCompatibleInflation(boolean gzipCompatibleInflation)
public void setExcludedUserAgentPatterns(Set<String> excludedUserAgentPatterns)
public boolean isSyncFlush()
public void setSyncFlush(boolean syncFlush)
public BiDiGzipHandler build(@Nullable org.eclipse.jetty.server.Handler handler)
Copyright © 2019. All rights reserved.