public class CompressionRule extends AbstractModel
header, skipSign| Constructor and Description | 
|---|
| CompressionRule() | 
| CompressionRule(CompressionRule source)NOTE: Any ambiguous key set via .set("AnyKey", "value") will be a shallow copy,
       and any explicit key, i.e Foo, set via .setFoo("value") will be a deep copy. | 
| Modifier and Type | Method and Description | 
|---|---|
| String[] | getAlgorithms()Get File compression algorithm
`gzip`: Gzip compression
`brotli`: Brotli compression
Note: This field may return `null`, indicating that no valid value can be obtained. | 
| Boolean | getCompress()Get true: must be set as true, enables compression
Note: this field may return `null`, indicating that no valid values can be obtained. | 
| String[] | getFileExtensions()Get Compress based on file suffix. | 
| Long | getMaxLength()Get The maximum file size to trigger compression (in bytes). | 
| Long | getMinLength()Get The minimum file size to trigger compression (in bytes)
Note: this field may return `null`, indicating that no valid values can be obtained. | 
| String[] | getRulePaths()Get Content for each `CacheType`:
For `all`, enter a wildcard `*`. | 
| String | getRuleType()Get Rule types:
`all`: Apply to all files. | 
| void | setAlgorithms(String[] Algorithms)Set File compression algorithm
`gzip`: Gzip compression
`brotli`: Brotli compression
Note: This field may return `null`, indicating that no valid value can be obtained. | 
| void | setCompress(Boolean Compress)Set true: must be set as true, enables compression
Note: this field may return `null`, indicating that no valid values can be obtained. | 
| void | setFileExtensions(String[] FileExtensions)Set Compress based on file suffix. | 
| void | setMaxLength(Long MaxLength)Set The maximum file size to trigger compression (in bytes). | 
| void | setMinLength(Long MinLength)Set The minimum file size to trigger compression (in bytes)
Note: this field may return `null`, indicating that no valid values can be obtained. | 
| void | setRulePaths(String[] RulePaths)Set Content for each `CacheType`:
For `all`, enter a wildcard `*`. | 
| void | setRuleType(String RuleType)Set Rule types:
`all`: Apply to all files. | 
| void | toMap(HashMap<String,String> map,
     String prefix)Internal implementation, normal users should not use it. | 
any, fromJsonString, getBinaryParams, GetHeader, getMultipartRequestParams, getSkipSign, set, SetHeader, setParamArrayObj, setParamArraySimple, setParamObj, setParamSimple, setSkipSign, toJsonStringpublic CompressionRule()
public CompressionRule(CompressionRule source)
public Boolean getCompress()
public void setCompress(Boolean Compress)
Compress - true: must be set as true, enables compression
Note: this field may return `null`, indicating that no valid values can be obtained.public Long getMinLength()
public void setMinLength(Long MinLength)
MinLength - The minimum file size to trigger compression (in bytes)
Note: this field may return `null`, indicating that no valid values can be obtained.public Long getMaxLength()
public void setMaxLength(Long MaxLength)
MaxLength - The maximum file size to trigger compression (in bytes).
The maximum value is 30 MB.
Note: This field may return `null`, indicating that no valid value can be obtained.public String[] getAlgorithms()
public void setAlgorithms(String[] Algorithms)
Algorithms - File compression algorithm
`gzip`: Gzip compression
`brotli`: Brotli compression
Note: This field may return `null`, indicating that no valid value can be obtained.public String[] getFileExtensions()
public void setFileExtensions(String[] FileExtensions)
FileExtensions - Compress based on file suffix.
File suffixes such as jpg and txt are supported.
Note: This field may return `null`, indicating that no valid value can be obtained.public String getRuleType()
public void setRuleType(String RuleType)
RuleType - Rule types:
`all`: Apply to all files.
`file`: Apply to files with the specified suffixes.
`directory`: Apply to specified paths.
`path`: Apply to specified absolute paths.
`contentType`: Apply when the `ContentType` is specified.
If this field is specified, `FileExtensions` does not take effect.
Note: This field may return `null`, indicating that no valid value can be obtained.public String[] getRulePaths()
public void setRulePaths(String[] RulePaths)
RulePaths - Content for each `CacheType`:
For `all`, enter a wildcard `*`.
For `file`, enter a suffix, e.g., `jpg` or `txt`.
For `directory`, enter a path, e.g., `/xxx/test/`.
For `path`, enter an absolute path, e.g., `/xxx/test.html`.
For `contentType`, enter `text/html`.
Note: This field may return `null`, indicating that no valid value can be obtained.Copyright © 2025. All rights reserved.