Queries a single cache rule for a specific site.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
esa:GetCacheRule |
get |
*Site
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| SiteId |
integer |
Yes |
The site ID. Call the ListSites operation to obtain this ID. |
123456**** |
| ConfigId |
integer |
Yes |
The configuration ID. Call the ListCacheRules operation to obtain this ID. |
352816096987136 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response schema. |
||
| RequestId |
string |
The request ID. |
36af3fcc-43d0-441c-86b1-428951dc8225 |
| ConfigId |
integer |
The configuration ID. |
352816096987136 |
| ConfigType |
string |
Whether the response contains a global or rule configuration. Valid values:
|
global |
| SiteVersion |
integer |
The version number of the site configuration. For sites with version management enabled, this value indicates the configuration version. Defaults to 0. |
1 |
| Sequence |
integer |
The rule execution order. Smaller values indicate higher priority. |
1 |
| RuleEnable |
string |
Whether the rule is enabled. Applies only to rule configurations. Valid values:
|
on |
| Rule |
string |
The rule content, a conditional expression used to match user requests. Applies only to rule configurations.
|
(http.host eq \"video.example.com\") |
| RuleName |
string |
The rule name. Applies only to rule configurations. |
rule_example |
| BypassCache |
string |
Whether to cache requests or bypass the cache. Valid values:
|
cache_all |
| BrowserCacheMode |
string |
The browser cache mode. Valid values:
|
follow_origin |
| BrowserCacheTtl |
string |
The browser cache TTL, in seconds. |
300 |
| EdgeCacheMode |
string |
The edge cache mode. Valid values:
|
follow_origin |
| EdgeCacheTtl |
string |
The edge cache TTL, in seconds. |
300 |
| EdgeStatusCodeCacheTtl |
string |
The status code cache TTL, in seconds.
|
5xx=0,404=10 |
| SortQueryStringForCache |
string |
Whether to sort query strings before generating the cache key. Valid values:
|
on |
| QueryStringMode |
string |
The query string handling mode for cache key generation. Valid values:
|
reserve_all |
| QueryString |
string |
The query strings to include in or exclude from the cache key. Separate multiple query strings with spaces. |
example |
| IncludeHeader |
string |
The headers to include in the cache key. Both header names (case-insensitive) and their values are added to the key. Separate multiple header names with spaces. Header names can contain the following characters:
|
headername1 headername2 |
| IncludeCookie |
string |
The cookies to include in the cache key. Both cookie names (case-insensitive) and their values are added to the key. Separate multiple cookie names with spaces. Cookie names can contain the following characters:
|
cookiename1 cookiename2 |
| CacheReserveEligibility |
string |
The cache reserve eligibility. Controls whether a request bypasses the cache reserve node during an origin fetch. Valid values:
|
bypass_cache_reserve |
| CheckPresenceHeader |
string |
The headers whose presence is checked when generating a cache key. If a specified header exists in the request, its name (case-insensitive) is added to the cache key. Separate multiple header names with spaces. Header names can contain the following characters:
|
headername1 headername2 |
| CheckPresenceCookie |
string |
The cookies whose presence is checked when generating a cache key. If a specified cookie exists in the request, its name (case-insensitive) is added to the cache key. Separate multiple cookie names with spaces. Cookie names can contain the following characters:
|
cookiename1 cookiename2 |
| UserDeviceType |
string |
Whether to include the client's device type in the cache key. Valid values:
|
on |
| UserGeo |
string |
Whether to include the client's geographic location in the cache key. Valid values:
|
on |
| UserLanguage |
string |
Whether to include the client's language in the cache key. Valid values:
|
on |
| ServeStale |
string |
Whether to serve stale content. When enabled, edge nodes serve stale (expired) cached content when the origin server is unavailable. Valid values:
|
on |
| AdditionalCacheablePorts |
string |
|
8880,2052,2086 |
| CacheDeceptionArmor |
string |
Whether to enable Cache Deception Armor, which helps mitigate web cache deception attacks by ensuring that only validated content is cached. Valid values:
|
on |
| PostCache |
string |
Whether to enable POST request caching. |
on |
| PostBodyCacheKey |
string |
The body content handling mode for POST request cache key generation. Valid values:
|
ignore |
| PostBodySizeLimit |
string |
The size limit (in KB) of the body content for POST caching. The value is an integer from 1 to 8. A null or empty value defaults to 8 KB. |
1 |
Examples
Success response
JSON format
{
"RequestId": "36af3fcc-43d0-441c-86b1-428951dc8225",
"ConfigId": 352816096987136,
"ConfigType": "global",
"SiteVersion": 1,
"Sequence": 1,
"RuleEnable": "on",
"Rule": "(http.host eq \\\"video.example.com\\\")\n",
"RuleName": "rule_example\n",
"BypassCache": "cache_all",
"BrowserCacheMode": "follow_origin",
"BrowserCacheTtl": "300",
"EdgeCacheMode": "follow_origin",
"EdgeCacheTtl": "300",
"EdgeStatusCodeCacheTtl": "5xx=0,404=10",
"SortQueryStringForCache": "on",
"QueryStringMode": "reserve_all",
"QueryString": "example",
"IncludeHeader": "headername1 headername2",
"IncludeCookie": "cookiename1 cookiename2",
"CacheReserveEligibility": "bypass_cache_reserve",
"CheckPresenceHeader": "headername1 headername2",
"CheckPresenceCookie": "cookiename1 cookiename2",
"UserDeviceType": "on",
"UserGeo": "on",
"UserLanguage": "on",
"ServeStale": "on",
"AdditionalCacheablePorts": "8880,2052,2086",
"CacheDeceptionArmor": "on",
"PostCache": "on",
"PostBodyCacheKey": "ignore",
"PostBodySizeLimit": "1"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InternalException | Failed to call the service. Try again later or contact technical support. | Failed to call the service. Try again later or contact technical support. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.