public class GzipHandlerFactory extends Object
| Name | Default | Description |
enabled |
true | If true, all requests with `gzip` in the `Accept-Encoding` header will have their response entities compressed and requests with `gzip` in the `Content-Encoding` header will have their request entities decompressed. |
minimumEntitySize |
256 bytes | All response entities under this DataSize are not compressed. |
bufferSize |
8KiB | The DataSize of the buffer to use when compressing. |
excludedUserAgentPatterns |
(Jetty's default) | A list of regex patterns for User-Agent names from which requests should not be compressed. The default
is [".*MSIE 6.0.*"] |
compressedMimeTypes |
(Jetty's default) | List of MIME types to compress. The default is all types apart the commonly known image, video, audio and compressed types. |
excludedMimeTypes |
(Jetty's default) | List of MIME types not to compress. The default is a list of commonly known image, video, audio and compressed types. |
includedPaths |
(Jetty's default) | List of paths to consider for compression. The default is all paths. |
excludedPaths |
(none) | List of paths to exclude from compression. Performs a String.startsWith(String) comparison to
check if the path matches. If it does match then there is no compression. To match subpaths use
excludePathPatterns instead. |
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 deflation(compression). |
gzipCompatibleInflation |
true | This option is unused and deprecated as compressed requests without header info are unsupported |
| Constructor and Description |
|---|
GzipHandlerFactory() |
| Modifier and Type | Method and Description |
|---|---|
org.eclipse.jetty.server.handler.gzip.GzipHandler |
build(org.eclipse.jetty.server.Handler handler) |
io.dropwizard.util.DataSize |
getBufferSize() |
Set<String> |
getCompressedMimeTypes() |
int |
getDeflateCompressionLevel() |
Set<String> |
getExcludedMimeTypes() |
Set<String> |
getExcludedPaths() |
Set<String> |
getExcludedUserAgentPatterns() |
Set<String> |
getIncludedMethods() |
Set<String> |
getIncludedPaths() |
io.dropwizard.util.DataSize |
getMinimumEntitySize() |
boolean |
isEnabled() |
boolean |
isGzipCompatibleInflation()
Deprecated.
gzip handler no longer supports inflate streams
|
boolean |
isSyncFlush() |
void |
setBufferSize(io.dropwizard.util.DataSize size) |
void |
setCompressedMimeTypes(Set<String> mimeTypes) |
void |
setDeflateCompressionLevel(int level) |
void |
setEnabled(boolean enabled) |
void |
setExcludedMimeTypes(Set<String> mimeTypes) |
void |
setExcludedPaths(Set<String> paths) |
void |
setExcludedUserAgentPatterns(Set<String> excludedUserAgentPatterns) |
void |
setGzipCompatibleInflation(boolean gzipCompatibleInflation)
Deprecated.
gzip handler no longer supports inflate streams
|
void |
setIncludedMethods(Set<String> methods) |
void |
setIncludedPaths(Set<String> paths) |
void |
setMinimumEntitySize(io.dropwizard.util.DataSize size) |
void |
setSyncFlush(boolean syncFlush) |
public boolean isEnabled()
public void setEnabled(boolean enabled)
public io.dropwizard.util.DataSize getMinimumEntitySize()
public void setMinimumEntitySize(io.dropwizard.util.DataSize size)
public io.dropwizard.util.DataSize getBufferSize()
public void setBufferSize(io.dropwizard.util.DataSize size)
public int getDeflateCompressionLevel()
public void setDeflateCompressionLevel(int level)
public boolean isGzipCompatibleInflation()
@Deprecated public void setGzipCompatibleInflation(boolean gzipCompatibleInflation)
public void setExcludedUserAgentPatterns(Set<String> excludedUserAgentPatterns)
public boolean isSyncFlush()
public void setSyncFlush(boolean syncFlush)
public org.eclipse.jetty.server.handler.gzip.GzipHandler build(@Nullable org.eclipse.jetty.server.Handler handler)
Copyright © 2019. All rights reserved.