public class CompressionConfig extends Object
| Constructor and Description |
|---|
CompressionConfig() |
| Modifier and Type | Method and Description |
|---|---|
String |
getCompressibleMimeType() |
String[] |
getCompressibleMimeTypes() |
String |
getCompression()
Return compression level.
|
int |
getCompressionLevel() |
int |
getCompressionMinSize() |
boolean |
getNoCompressionStrongETag()
Deprecated.
Will be removed in Tomcat 10 where it will be hard-coded to
true |
String |
getNoCompressionUserAgents()
Obtain the String form of the regular expression that defines the user
agents to not use gzip with.
|
Pattern |
getNoCompressionUserAgentsPattern() |
void |
setCompressibleMimeType(String valueS) |
void |
setCompression(String compression)
Set compression level.
|
void |
setCompressionMinSize(int compressionMinSize)
Set Minimum size to trigger compression.
|
void |
setNoCompressionStrongETag(boolean noCompressionStrongETag)
Deprecated.
Will be removed in Tomcat 10 where it will be hard-coded to
true |
void |
setNoCompressionUserAgents(String noCompressionUserAgents)
Set no compression user agent pattern.
|
boolean |
useCompression(Request request,
Response response)
Determines if compression should be enabled for the given response and if
it is, sets any necessary headers to mark it as such.
|
public void setCompression(String compression)
compression - One of on, force,
off or the minimum compression size in
bytes which implies onpublic String getCompression()
public int getCompressionLevel()
public String getNoCompressionUserAgents()
public Pattern getNoCompressionUserAgentsPattern()
public void setNoCompressionUserAgents(String noCompressionUserAgents)
Pattern. e.g.: gorilla|desesplorer|tigrus.noCompressionUserAgents - The regular expression for user agent
strings for which compression should not
be appliedpublic String getCompressibleMimeType()
public void setCompressibleMimeType(String valueS)
public String[] getCompressibleMimeTypes()
public int getCompressionMinSize()
public void setCompressionMinSize(int compressionMinSize)
compressionMinSize - The minimum content length required for
compression in bytes@Deprecated public boolean getNoCompressionStrongETag()
truetrue if compression is disabled, otherwise false@Deprecated public void setNoCompressionStrongETag(boolean noCompressionStrongETag)
truenoCompressionStrongETag - true if compression is disabled,
otherwise falsepublic boolean useCompression(Request request, Response response)
request - The request that triggered the responseresponse - The response to consider compressingtrue if compression was enabled for the given response,
otherwise falseCopyright © 2000-2021 Apache Software Foundation. All Rights Reserved.