Package io.dropwizard.jetty
Class GzipHandlerFactory
java.lang.Object
io.dropwizard.jetty.GzipHandlerFactory
Builds GZIP filters.
Configuration Parameters:
| 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. |
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.jetty.server.handler.gzip.GzipHandlerbuild(@Nullable org.eclipse.jetty.server.Handler handler) io.dropwizard.util.DataSizeintio.dropwizard.util.DataSizebooleanbooleanvoidsetBufferSize(io.dropwizard.util.DataSize size) voidsetCompressedMimeTypes(Set<String> mimeTypes) voidsetDeflateCompressionLevel(int level) voidsetEnabled(boolean enabled) voidsetExcludedMimeTypes(Set<String> mimeTypes) voidsetExcludedPaths(Set<String> paths) voidsetIncludedMethods(Set<String> methods) voidsetIncludedPaths(Set<String> paths) voidsetMinimumEntitySize(io.dropwizard.util.DataSize size) voidsetSyncFlush(boolean syncFlush)
-
Constructor Details
-
GzipHandlerFactory
public GzipHandlerFactory()
-
-
Method Details
-
isEnabled
public boolean isEnabled() -
setEnabled
public void setEnabled(boolean enabled) -
getMinimumEntitySize
public io.dropwizard.util.DataSize getMinimumEntitySize() -
setMinimumEntitySize
public void setMinimumEntitySize(io.dropwizard.util.DataSize size) -
getBufferSize
public io.dropwizard.util.DataSize getBufferSize() -
setBufferSize
public void setBufferSize(io.dropwizard.util.DataSize size) -
getCompressedMimeTypes
-
setCompressedMimeTypes
-
getExcludedMimeTypes
- Since:
- 2.0
-
setExcludedMimeTypes
- Since:
- 2.0
-
getDeflateCompressionLevel
public int getDeflateCompressionLevel() -
setDeflateCompressionLevel
public void setDeflateCompressionLevel(int level) -
getIncludedMethods
-
setIncludedMethods
-
getExcludedPaths
- Since:
- 2.0
-
setExcludedPaths
- Since:
- 2.0
-
getIncludedPaths
- Since:
- 2.0
-
setIncludedPaths
- Since:
- 2.0
-
isSyncFlush
public boolean isSyncFlush() -
setSyncFlush
public void setSyncFlush(boolean syncFlush) -
build
public org.eclipse.jetty.server.handler.gzip.GzipHandler build(@Nullable org.eclipse.jetty.server.Handler handler)
-