All Products
Search
Document Center

Edge Security Acceleration:ListCacheRules

Last Updated:Nov 15, 2025
This topic is generated by a machine translation engine without any human intervention. ALIBABA CLOUD DOES NOT GUARANTEE THE ACCURACY OF MACHINE TRANSLATED CONTENT. To request a human-translated version of this topic or provide feedback on this translation, please include it in the feedback form.

Query multiple cache configurations

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
esa:ListCacheRulesnone
*Site
acs:esa:{#regionId}:{#accountId}:site/{#SiteId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
SiteIdlongYes

Site ID, which can be obtained by calling the ListSites interface.

123456****
ConfigIdlongNo

Configuration ID.

35281609698****
ConfigTypestringNo

Configuration type, which can be used to query global or rule-based configurations. Possible values:

  • global: Query global configuration.
  • rule: Query rule-based configuration.

This parameter is optional; if not provided, it will not distinguish between global and rule-based configurations.

global
RuleNamestringNo

Rule name. This parameter is not required when adding a global configuration.

test
PageNumberintegerNo

Page number, defaulting to 1 if not provided.

1
PageSizeintegerNo

Number of items per page, with a maximum of 500. Defaults to 500 if not provided.

20
SiteVersionintegerNo

Site version number. For sites with version management enabled, this parameter can specify the site version for which the configuration takes effect, defaulting to version 0.

1

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

Request ID.

36af3fcc-43d0-441c-86b1-428951dc8225
Configsarray<object>

Response body configuration.

configsobject
ConfigIdlong

Configuration ID.

395386449776640
SiteVersioninteger

Site configuration version number. For sites with version management enabled, this parameter can specify the site version for which the configuration takes effect, defaulting to version 0.

1
Sequenceinteger

Rule execution order. The smaller the value, the higher the priority.

1
RuleEnablestring

Rule switch. This parameter is not required when adding a global configuration. Possible values:

  • on: Enabled.
  • off: Disabled.
on
Rulestring

Rule content, using conditional expressions to match user requests. This parameter is not required when adding a global configuration. There are two usage scenarios:

  • Match all incoming requests: Set the value to true
  • Match specific requests: Set the value to a custom expression, e.g., (http.host eq "video.example.com")
(http.host eq \"video.example.com\")
RuleNamestring

Rule name. This parameter is not required when adding a global configuration.

rule_example
ConfigTypestring

Configuration type, which can be used to query global or rule-based configurations. Possible values:

  • global: Query global configuration.
  • rule: Query rule-based configuration.
global
BypassCachestring

Set bypass cache mode. Possible values:

  • cache_all: Cache all requests.
  • bypass_all: Bypass cache for all requests.
cache_all
BrowserCacheModestring

Browser cache mode. Possible values:

  • no_cache: Do not cache.
  • follow_origin: Follow origin cache policy.
  • override_origin: Override origin cache policy.
no_cache
BrowserCacheTtlstring

Browser cache expiration time, in seconds.

300
EdgeCacheModestring

Edge cache mode. The value range is as follows:

  • follow_origin: Follow the origin server's cache policy (if it exists), otherwise use the default cache policy.
  • no_cache: Do not cache.
  • override_origin: Override the origin server's cache policy.
  • follow_origin_bypass: Follow the origin server's cache policy (if it exists), otherwise do not cache.
follow_origin
EdgeCacheTtlstring

Edge cache expiration time, in seconds.

300
EdgeStatusCodeCacheTtlstring

Edge cache expiration time, in seconds.

300
SortQueryStringForCachestring

Query string sorting. The value range is as follows:

  • on: Enable.
  • off: Disable.
on
QueryStringModestring

The processing mode for query strings when generating the cache key. The value range is as follows:

  • ignore_all: Ignore all query strings.
  • exclude_query_string: Exclude specified query strings.
  • reserve_all: Default, reserve all query strings.
  • include_query_string: Include specified query strings.
ignore_all
QueryStringstring

The query strings to be reserved or excluded. Multiple values are supported, separated by spaces.

example
IncludeHeaderstring

Include the specified header names and their values when generating the cache key. Multiple values are supported, separated by spaces.

example
IncludeCookiestring

Include the specified cookie names and their values when generating the cache key. Multiple values are supported, separated by spaces.

cookie_exapmle
CacheReserveEligibilitystring

Cache reserve eligibility. This is used to control whether user requests bypass the cache reserve node when returning to the origin. The value range is as follows:

  • bypass_cache_reserve: Requests bypass the cache reserve.
  • eligible_for_cache_reserve: Eligible for cache reserve.
bypass_cache_reserve
CheckPresenceHeaderstring

When generating the cache key, check if the header exists. If it does, add the header name (case-insensitive) to the cache key. Multiple header names are supported, separated by spaces.

headername
CheckPresenceCookiestring

When generating the cache key, check if the cookie exists. If it does, add the cookie name (case-insensitive) to the cache key. Multiple cookie names are supported, separated by spaces.

cookiename
UserDeviceTypestring

Include the client device type when generating the cache key. The value range is as follows:

  • on: Enable.
  • off: Disable.
on
UserGeostring

Include the client's geographic location when generating the cache key. The value range is as follows:

  • on: Enable.
  • off: Disable.
on
UserLanguagestring

Include the client's language type when generating the cache key. The value range is as follows:

  • on: Enable.
  • off: Disable.
on
ServeStalestring

Serve stale cache. When enabled, the node can still respond to user requests with expired cached files even when the origin server is unavailable. Value range:

  • on: Enabled.
  • off: Disabled.
on
AdditionalCacheablePortsstring

Enable caching on specified ports. Value range: 8880, 2052, 2082, 2086, 2095, 2053, 2083, 2087, 2096.

2082
CacheDeceptionArmorstring

Cache deception defense. Used to defend against web cache deception attacks; only verified cache content will be cached. Value range:

  • on: Enabled.
  • off: Disabled.
on
PageNumberinteger

Current page number.

1
PageSizeinteger

Page size.

10
TotalCountinteger

Total number of records.

20
TotalPageinteger

Total number of pages.

2

Examples

Sample success responses

JSONformat

{
  "RequestId": "36af3fcc-43d0-441c-86b1-428951dc8225",
  "Configs": [
    {
      "ConfigId": 395386449776640,
      "SiteVersion": 1,
      "Sequence": 1,
      "RuleEnable": "on",
      "Rule": "(http.host eq \\\"video.example.com\\\")",
      "RuleName": "rule_example",
      "ConfigType": "global",
      "BypassCache": "cache_all",
      "BrowserCacheMode": "no_cache",
      "BrowserCacheTtl": 300,
      "EdgeCacheMode": "follow_origin",
      "EdgeCacheTtl": 300,
      "EdgeStatusCodeCacheTtl": 300,
      "SortQueryStringForCache": "on",
      "QueryStringMode": "ignore_all",
      "QueryString": "example",
      "IncludeHeader": "example",
      "IncludeCookie": "cookie_exapmle",
      "CacheReserveEligibility": "bypass_cache_reserve",
      "CheckPresenceHeader": "headername",
      "CheckPresenceCookie": "cookiename",
      "UserDeviceType": "on",
      "UserGeo": "on",
      "UserLanguage": "on",
      "ServeStale": "on",
      "AdditionalCacheablePorts": 2082,
      "CacheDeceptionArmor": "on"
    }
  ],
  "PageNumber": 1,
  "PageSize": 10,
  "TotalCount": 20,
  "TotalPage": 2
}

Error codes

HTTP status codeError codeError messageDescription
400InternalExceptionFailed to call the service. Try again later or contact technical support.Failed to call the service. Try again later or contact technical support.
400InvalidParameter.FunctionNameThe specified feature does not exist. Specify a valid feature name based on the related documentation.The specified feature does not exist. Specify a valid feature name based on the related documentation.

For a list of error codes, visit the Service error codes.