All Products
Search
Document Center

Edge Security Acceleration:ListCacheRules

Last Updated:Jun 25, 2026

Queries multiple cache configurations.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

esa:ListCacheRules

list

*Site

acs:esa:{#regionId}:{#accountId}:site/{#SiteId}

None None

Request parameters

Parameter

Type

Required

Description

Example

SiteId

integer

Yes

The site ID, which can be obtained by calling the ListSites operation.

123456****

ConfigId

integer

No

The configuration ID.

35281609698****

ConfigType

string

No

The configuration type. You can use this parameter to query global or rule configurations. Valid values:

  • global: queries global configurations.

  • rule: queries rule configurations.

This parameter is optional. If you do not specify this parameter, both global and rule configurations are returned.

Valid values:

  • rule :

    rule configuration.

  • global :

    global configuration.

global

RuleName

string

No

The rule name. You do not need to set this parameter when you add a global configuration.

test

PageNumber

integer

No

The page number for a paged query. The value must be greater than or equal to 1.

1

PageSize

integer

No

The number of entries per page for a paged query. Valid values: 1 to 500.

20

SiteVersion

integer

No

The version number of the site. For sites with version management enabled, you can use this parameter to specify the site version for which the configuration takes effect. Default value: 0.

1

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

The request ID.

36af3fcc-43d0-441c-86b1-428951dc8225

Configs

array<object>

The configuration list in the response body.

object

ConfigId

integer

The configuration ID.

395386449776640

SiteVersion

integer

The version number of the site configuration. For sites with configuration version management enabled, you can use this parameter to specify the site version for which the configuration takes effect. Default value: 0.

1

Sequence

integer

The rule execution order. A smaller value indicates a higher priority.

1

RuleEnable

string

The rule switch. You do not need to set this parameter when you add a global configuration. Valid values:

  • on: enabled.

  • off: disabled.

on

Rule

string

The rule content, which uses conditional expressions to match user requests. You do not need to set this parameter when you add a global configuration. Two scenarios are supported:

  • Match all incoming requests: set the value to true.

  • Match specified requests: set the value to a custom expression, such as (http.host eq "video.example.com").

(http.host eq \"video.example.com\")

RuleName

string

The rule name. You do not need to set this parameter when you add a global configuration.

rule_example

ConfigType

string

The configuration type. You can use this parameter to query global or rule configurations. Valid values:

  • global: global configuration.

  • rule: rule configuration.

global

BypassCache

string

The bypass cache mode. Valid values:

  • cache_all: caches all requests.

  • bypass_all: bypasses cache for all requests.

cache_all

BrowserCacheMode

string

The browser cache mode. Valid values:

  • no_cache: does not cache.

  • follow_origin: follows the origin cache policy.

  • override_origin: overrides the origin cache policy.

no_cache

BrowserCacheTtl

string

The browser cache expiration time, in seconds.

300

EdgeCacheMode

string

The edge cache mode. Valid values:

  • follow_origin: follows the origin cache policy if present. Otherwise, uses the default cache policy.

  • no_cache: does not cache.

  • override_origin: overrides the origin cache policy.

  • follow_origin_bypass: follows the origin cache policy if present. Otherwise, does not cache.

  • follow_origin_override: follows the origin cache policy if present. Otherwise, uses a custom cache TTL.

follow_origin

EdgeCacheTtl

string

The edge cache expiration time, in seconds.

300

EdgeStatusCodeCacheTtl

string

The status code cache expiration time, in seconds.

  • You can set the cache expiration time for specific status codes. For example, 404=10 indicates that the 404 status code is cached for 10 seconds.

  • You can set the cache expiration time for 4xx or 5xx series status codes. For example, 4xx=10 indicates that all 4xx status codes are cached for 10 seconds.

  • You can set the cache expiration time for multiple status codes. Separate multiple status codes with commas (,).

5xx=0,404=10

SortQueryStringForCache

string

Specifies whether to sort query strings. Valid values:

  • on: enabled.

  • off: disabled.

on

QueryStringMode

string

The query string handling mode when generating cache keys. Valid values:

  • ignore_all: ignores all query strings.

  • exclude_query_string: removes specified query strings.

  • reserve_all: retains all query strings. This is the default value.

  • include_query_string: retains specified query strings.

ignore_all

QueryString

string

The query strings to retain or remove when generating cache keys. Multiple values are separated by spaces.

example

IncludeHeader

string

The specified header names (case-insensitive) and their values to include when generating cache keys. Multiple values are separated by spaces. Header names support the following character types:

  • Symbols: ! # $ % & ' * + - . ^ _ ` | ~

  • Digits: 0-9

  • Letters: lowercase a-z.

headername1 headername2

IncludeCookie

string

The specified cookie names (case-insensitive) and their values to include when generating cache keys. Multiple values are separated by spaces. Cookie names support the following character types:

  • Symbols: ! # $ % & ' * + - . ^ _ ` | ~

  • Digits: 0-9

  • Letters: lowercase a-z.

cookiename1 cookiename2

CacheReserveEligibility

string

The cache reserve eligibility. Controls whether user requests bypass the cache reserve node during back-to-origin. Valid values:

  • bypass_cache_reserve: requests bypass cache reserve.

  • eligible_for_cache_reserve: requests are eligible for cache reserve.

bypass_cache_reserve

CheckPresenceHeader

string

When generating cache keys, checks whether the specified headers exist. If a header exists, its name (case-insensitive) is added to the cache key. Multiple header names are separated by spaces. Header names support the following character types:

  • Symbols: ! # $ % & ' * + - . ^ _ ` | ~

  • Digits: 0-9

  • Letters: lowercase a-z.

headername1 headername2

CheckPresenceCookie

string

When generating cache keys, checks whether the specified cookies exist. If a cookie exists, its name (case-insensitive) is added to the cache key. Multiple cookie names are separated by spaces. Cookie names support the following character types:

  • Symbols: ! # $ % & ' * + - . ^ _ ` | ~

  • Digits: 0-9

  • Letters: lowercase a-z.

cookiename1 cookiename2

UserDeviceType

string

Specifies whether to include the type of the client when generating cache keys. Valid values:

  • on: enabled.

  • off: shutdown.

on

UserGeo

string

Specifies whether to include the client geographic location when generating cache keys. Valid values:

  • on: enabled.

  • off: disabled.

on

UserLanguage

string

Specifies whether to include the client language type when generating cache keys. Valid values:

  • on: enabled.

  • off: disabled.

on

ServeStale

string

Specifies whether to serve stale cache. When enabled, edge nodes can respond to user requests with cached expired files when the origin server is unavailable. Valid values:

  • on: enabled.

  • off: disabled.

on

AdditionalCacheablePorts

string

  • Enables caching on specified ports.

  • Valid values: 8880, 2052, 2082, 2086, 2095, 2053, 2083, 2087, and 2096.

  • Multiple ports are separated by commas (,).

8880,2052,2086

CacheDeceptionArmor

string

The cache deception armor. Protects against web cache deception attacks by caching only content that passes validation. Valid values:

  • on: enabled.

  • off: disabled.

on

PostCache

string

Specifies whether to enable POST caching.

on

PostBodyCacheKey

string

The cache key handling mode for POST caching. The following two modes are supported:

  • md5: calculates the MD5 hash of the body content and adds the MD5 value to the cache key.

  • ignore: ignores the body content in the cache key.

ignore

PostBodySizeLimit

string

The body size limit for POST caching. The value is a number in KB. Valid values: 1 to 8. If this parameter is left empty, the default value of 8 KB takes effect.

1

PageNumber

integer

The current page number, which is the same as the PageNumber request parameter.

1

PageSize

integer

The number of entries per page.

10

TotalCount

integer

The total number of records.

20

TotalPage

integer

The total number of pages.

2

Examples

Success response

JSON format

{
  "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": "5xx=0,404=10",
      "SortQueryStringForCache": "on",
      "QueryStringMode": "ignore_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"
    }
  ],
  "PageNumber": 1,
  "PageSize": 10,
  "TotalCount": 20,
  "TotalPage": 2
}

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.
400 InvalidParameter.FunctionName The 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.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.