All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::ESA::CacheRule

Last Updated:Jul 05, 2026

The ALIYUN::ESA::CacheRule resource type adds a cache configuration to a site.

Syntax

{
  "Type": "ALIYUN::ESA::CacheRule",
  "Properties": {
    "SiteId": Integer,
    "AdditionalCacheablePorts": Integer,
    "BrowserCacheMode": String,
    "BrowserCacheTtl": Integer,
    "BypassCache": String,
    "CheckPresenceHeader": String,
    "CheckPresenceCookie": String,
    "CacheReserveEligibility": String,
    "CacheDeceptionArmor": String,
    "EdgeCacheTtl": Integer,
    "EdgeCacheMode": String,
    "EdgeStatusCodeCacheTtl": String,
    "IncludeCookie": String,
    "IncludeHeader": String,
    "QueryString": String,
    "QueryStringMode": String,
    "RuleName": String,
    "RuleEnable": String,
    "Rule": String,
    "Sequence": Integer,
    "SortQueryStringForCache": String,
    "ServeStale": String,
    "SiteVersion": Integer,
    "UserGeo": String,
    "UserDeviceType": String,
    "UserLanguage": String
  }
}

Properties

Parameter

Type

Required

Editable

Description

Constraints

SiteId

Integer

Yes

No

The site ID.

None

AdditionalCacheablePorts

Integer

No

Yes

Enables caching on specified additional ports.

Valid values:

  • 8880

  • 2052

  • 2082

  • 2086

  • 2095

  • 2053

  • 2083

  • 2087

  • 2096

BrowserCacheMode

String

No

Yes

Specifies the browser cache mode.

Valid values:

  • no_cache: Disables browser caching.

  • follow_origin: Follows the origin's caching policy.

  • override_origin: Overrides the origin's caching policy.

BrowserCacheTtl

Integer

No

Yes

Specifies the browser cache TTL.

Unit: seconds.

BypassCache

String

No

Yes

Specifies the cache bypass mode.

Valid values:

  • cache_all: Caches all requests.

  • bypass_all: Bypasses the cache for all requests.

CacheDeceptionArmor

String

No

Yes

Enables or disables Cache Deception Armor.

Protects against web cache deception attacks by caching only verified content. Valid values:

  • on: Enabled.

  • off: Disabled.

CacheReserveEligibility

String

No

Yes

Specifies whether a request is eligible for cache reserve.

Controls whether a request bypasses the cache reserve node when it is forwarded to the origin. Valid values:

  • bypass_cache_reserve: The request bypasses the cache reserve.

  • eligible_for_cache_reserve: The request is eligible for cache reserve.

CheckPresenceCookie

String

No

Yes

Specifies a cookie to check when generating the cache key.

If the cookie exists, its name (case-insensitive) is added to the cache key. You can specify multiple cookie names, separated by spaces.

CheckPresenceHeader

String

No

Yes

Specifies a header to check when generating the cache key.

If the header exists, its name (case-insensitive) is added to the cache key. You can specify multiple header names, separated by spaces.

EdgeCacheMode

String

No

Yes

Specifies the edge cache mode.

Valid values:

  • follow_origin: Follows the origin's cache policy. If no policy exists, the default cache policy applies.

  • no_cache: Disables caching.

  • override_origin: Overrides the origin's cache policy.

  • follow_origin_bypass: Follows the origin's cache policy. If no policy exists, requests are not cached.

EdgeCacheTtl

Integer

No

Yes

Specifies the edge cache TTL.

Unit: seconds.

EdgeStatusCodeCacheTtl

String

No

Yes

Specifies the cache TTL for responses with specific status codes.

Unit: seconds. You can specify multiple values, separated by commas. Example: 4xx=999999,5xx=999998

IncludeCookie

String

No

Yes

Specifies the names of cookies to include in the cache key.

You can specify multiple cookie names, separated by spaces.

IncludeHeader

String

No

Yes

Specifies the names of headers to include in the cache key.

You can specify multiple header names, separated by spaces.

QueryString

String

No

Yes

Specifies the query string parameters to include or exclude.

You can specify multiple parameter names, separated by spaces.

QueryStringMode

String

No

Yes

Specifies how to handle query strings when generating the cache key.

Valid values:

  • ignore_all: Ignores all query strings.

  • exclude_query_string: Excludes the query strings specified in the QueryString parameter.

  • reserve_all: Includes all query strings by default.

  • include_query_string: Includes only the query strings specified in the QueryString parameter.

Rule

String

No

Yes

Defines the conditional expression used to match user requests.

This parameter is not required when adding a global configuration. You can use it in two ways:

- To match all incoming requests, set the value to true.

- To match specific requests, set the value to a custom expression, such as (http.host eq "video.example.com").

RuleEnable

String

No

Yes

Specifies whether to enable the rule.

This parameter is not required when adding a global configuration. Valid values:

  • on: Enabled.

  • off: Disabled.

RuleName

String

No

Yes

Specifies the name of the rule.

This parameter is not required when adding a global configuration.

Sequence

Integer

No

Yes

Specifies the execution order of the rule.

A smaller value indicates a higher priority.

ServeStale

String

No

Yes

Specifies whether to enable the serve stale feature.

If enabled, a node can use expired cached files to respond to requests when the origin is unavailable. Valid values:

  • on: Enabled.

  • off: Disabled.

SiteVersion

Integer

No

No

Specifies the version number of the site configuration.

For sites with version management enabled, this parameter specifies the configuration version to apply. The default value is 0.

SortQueryStringForCache

String

No

Yes

Specifies whether to sort query string parameters alphabetically before generating the cache key.

This feature is disabled by default. Valid values:

  • on: Enabled.

  • off: Disabled.

UserDeviceType

String

No

Yes

Specifies whether to include the client's device type in the cache key.

Valid values:

  • on: Enabled.

  • off: Disabled.

UserGeo

String

No

Yes

Specifies whether to include the client's geographic location in the cache key.

Valid values:

  • on: Enabled.

  • off: Disabled.

UserLanguage

String

No

Yes

Specifies whether to include the client's language in the cache key.

Valid values:

  • on: Enabled.

  • off: Disabled.

Return values

Fn::GetAtt

  • EdgeCacheTtl: The edge cache TTL, in seconds.

  • EdgeCacheMode: The edge cache mode.

  • EdgeStatusCodeCacheTtl: The cache TTL for specific status codes, in seconds.

  • BrowserCacheMode: The browser cache mode.

  • UserGeo: Whether to include the client's geographic location in the cache key.

  • IncludeCookie: The names and values of cookies included in the cache key. Multiple values are separated by spaces.

  • BrowserCacheTtl: The browser cache TTL, in seconds.

  • ConfigType: The configuration type, which can be global or rule-based.

  • RuleName: The name of the rule. Not required for global configurations.

  • RuleEnable: Whether the rule is enabled. Not required for global configurations.

  • QueryString: The query strings to be retained or excluded. Multiple values are separated by spaces.

  • QueryStringMode: How query strings are handled when generating the cache key.

  • Sequence: The execution priority of the rule. A smaller value indicates a higher priority.

  • BypassCache: The cache bypass mode.

  • CheckPresenceHeader: The names of headers to check for in a request. If a specified header is present, its name is added to the cache key, case-insensitively. Multiple header names are separated by spaces.

  • SortQueryStringForCache: Whether query strings are sorted before cache key generation. This feature is disabled by default.

  • CheckPresenceCookie: The names of cookies to check for in a request. If a specified cookie is present, its name is added to the cache key, case-insensitively. Multiple cookie names are separated by spaces.

  • UserDeviceType: Whether to include the client's device type in the cache key.

  • AdditionalCacheablePorts: The additional ports that support caching.

  • CacheReserveEligibility: Controls whether a user request bypasses the cache reserve node when forwarded to the origin.

  • Rule: The content of the rule, which uses a conditional expression to match user requests. Not required for global configurations.

  • UserLanguage: Whether to include the client's language in the cache key.

  • CacheDeceptionArmor: Indicates whether Cache Deception Armor is enabled. This feature protects against web cache deception attacks by caching only verified content.

  • CacheRuleId: The ID of the cache rule.

  • ServeStale: Whether to serve stale (expired) content from the cache when the origin is unavailable.

  • SiteVersion: The version number of the site configuration. For sites with version management enabled, this parameter specifies the effective version. The default value is 0.

  • IncludeHeader: The names and values of headers included in the cache key. Multiple values are separated by spaces.

Examples

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  AdditionalCacheablePorts:
    Type: Number
    Description:
      en: 'Specifies the ports on which to enable caching. Valid values: 8880, 2052, 2082, 2086, 2095, 2053, 2083, 2087, and 2096.'
    AllowedValues:
      - 8880
      - 2052
      - 2082
      - 2086
      - 2095
      - 2053
      - 2083
      - 2087
      - 2096
    Required: false
  BrowserCacheMode:
    Type: String
    Description:
      en: |-
        Specifies the browser cache mode. Valid values:
        - `no_cache`: Tells the browser not to cache the response.
        - `follow_origin`: Tells the browser to use the origin server's cache policy.
        - `override_origin`: Tells the browser to override the origin server's cache policy.
    AllowedValues:
      - no_cache
      - follow_origin
      - override_origin
    Required: false
  BrowserCacheTtl:
    Type: Number
    Description:
      en: 'Specifies the browser cache time-to-live (TTL) in seconds. This sets the `max-age` value in the `Cache-Control` header sent to the browser.'
    Required: false
  BypassCache:
    Type: String
    Description:
      en: |-
        Specifies the caching mode. Valid values:
        - `cache_all`: Caches all requests.
        - `bypass_all`: Bypasses the cache for all requests.
    AllowedValues:
      - cache_all
      - bypass_all
    Required: false
  CacheDeceptionArmor:
    Type: String
    Description:
      en: |-
        Specifies whether to enable Cache Deception Armor. This feature defends against web cache deception attacks by caching only the content that passes validation. Valid values:
        - `on`: Enabled.
        - `off`: Disabled.
    AllowedValues:
      - 'on'
      - 'off'
    Required: false
  CacheReserveEligibility:
    Type: String
    Description:
      en: |-
        Specifies the cache reserve eligibility. This setting controls whether a request that misses the cache is sent to a cache reserve node before it is forwarded to the origin server. Valid values:
        - `bypass_cache_reserve`: The request bypasses the cache reserve.
        - `eligible_for_cache_reserve`: The request is eligible for the cache reserve.
    AllowedValues:
      - bypass_cache_reserve
      - eligible_for_cache_reserve
    Required: false
  CheckPresenceCookie:
    Type: String
    Description:
      en: 'Specifies one or more cookie names. If a request contains a specified cookie, the cookie''s name (case-insensitive) is included in the cache key. Separate multiple cookie names with spaces.'
    Required: false
  CheckPresenceHeader:
    Type: String
    Description:
      en: 'Specifies one or more header names. If a request contains a specified header, the header''s name (case-insensitive) is included in the cache key. Separate multiple header names with spaces.'
    Required: false
  EdgeCacheMode:
    Type: String
    Description:
      en: |-
        Specifies the edge cache mode. Valid values:
        - `follow_origin`: Follows the cache policy of the origin server. If no policy is configured on the origin server, the default cache policy is used.
        - `no_cache`: Disables caching for all requests.
        - `override_origin`: Overrides the cache policy of the origin server.
        - `follow_origin_bypass`: Follows the cache policy of the origin server. If no policy is configured on the origin server, requests are not cached.
    AllowedValues:
      - follow_origin
      - no_cache
      - override_origin
      - follow_origin_bypass
    Required: false
  EdgeCacheTtl:
    Type: Number
    Description:
      en: The expiration time of the edge cache, in seconds.
    Required: false
  EdgeStatusCodeCacheTtl:
    Type: String
    Description:
      en: 'The cache TTL for responses with specific status codes, in seconds. Use commas to separate multiple values. For example: `4xx=999999,5xx=999998`'
    Required: false
  IncludeCookie:
    Type: String
    Description:
      en: 'Specifies the cookie names to include in the cache key. Both the name and value of each specified cookie are included. Separate multiple cookie names with spaces.'
    Required: false
  IncludeHeader:
    Type: String
    Description:
      en: 'Specifies the header names to include in the cache key. Both the name and value of each specified header are included. Separate multiple header names with spaces.'
    Required: false
  QueryString:
    Type: String
    Description:
      en: The query strings to include in or exclude from the cache key. Separate multiple query strings with spaces.
    Required: false
  QueryStringMode:
    Type: String
    Description:
      en: |-
        Specifies how to handle query strings when generating the cache key. Valid values:
        - `ignore_all`: Ignores all query strings.
        - `exclude_query_string`: Excludes the specified query strings.
        - `reserve_all`: Default. Includes all query strings.
        - `include_query_string`: Includes only the specified query strings.
    AllowedValues:
      - ignore_all
      - exclude_query_string
      - reserve_all
      - include_query_string
    Required: false
  Rule:
    Type: String
    Description:
      en: |-
        The conditional expression used to match requests for this rule. This parameter is not required for a global configuration.
        - To apply the rule to all requests, set the value to `true`.
        - To apply the rule to specific requests, use a custom expression, such as `(http.host eq "video.example.com")`.
    Required: false
  RuleEnable:
    Type: String
    Description:
      en: |-
        Specifies whether to enable the rule. This parameter is not required for a global configuration. Valid values:
        - `on`: Enabled.
        - `off`: Disabled.
    AllowedValues:
      - 'on'
      - 'off'
    Required: false
  RuleName:
    Type: String
    Description:
      en: The name of the rule. This parameter is not required for a global configuration.
    Required: false
  Sequence:
    Type: Number
    Description:
      en: The execution priority of the rule. A smaller value indicates a higher priority.
    Required: false
  ServeStale:
    Type: String
    Description:
      en: |-
        Specifies whether to enable Serve Stale. If enabled, edge nodes can serve stale (expired) content from the cache when the origin server is unavailable. Valid values:
        - `on`: Enabled.
        - `off`: Disabled.
    AllowedValues:
      - 'on'
      - 'off'
    Required: false
  SiteId:
    Type: Number
    Description:
      en: The ID of the site. You can obtain the site ID by calling the `ListSites` operation.
    Required: true
  SiteVersion:
    Type: Number
    Description:
      en: The version of the site configuration to which the rule applies. This parameter is used for sites where configuration versioning is enabled. The default value is 0.
    Required: false
  SortQueryStringForCache:
    Type: String
    Description:
      en: |-
        Specifies whether to sort query strings in the cache key. Sorting ensures that URLs with the same query strings in a different order are treated as the same request. By default, this feature is disabled. Valid values:
        - `on`: Enabled.
        - `off`: Disabled.
    AllowedValues:
      - 'on'
      - 'off'
    Required: false
  UserDeviceType:
    Type: String
    Description:
      en: |-
        Specifies whether to include the client's device type (such as mobile, desktop, or tablet) in the cache key. Valid values:
        - `on`: Enabled.
        - `off`: Disabled.
    AllowedValues:
      - 'on'
      - 'off'
    Required: false
  UserGeo:
    Type: String
    Description:
      en: |-
        Specifies whether to include the client's geographic location in the cache key. Valid values:
        - `on`: Enabled.
        - `off`: Disabled.
    AllowedValues:
      - 'on'
      - 'off'
    Required: false
  UserLanguage:
    Type: String
    Description:
      en: |-
        Specifies whether to include the client's language (from the `Accept-Language` header) in the cache key. Valid values:
        - `on`: Enabled.
        - `off`: Disabled.
    AllowedValues:
      - 'on'
      - 'off'
    Required: false
Resources:
  ExtensionResource:
    Type: ALIYUN::ESA::CacheRule
    Properties:
      AdditionalCacheablePorts:
        Ref: AdditionalCacheablePorts
      BrowserCacheMode:
        Ref: BrowserCacheMode
      BrowserCacheTtl:
        Ref: BrowserCacheTtl
      BypassCache:
        Ref: BypassCache
      CacheDeceptionArmor:
        Ref: CacheDeceptionArmor
      CacheReserveEligibility:
        Ref: CacheReserveEligibility
      CheckPresenceCookie:
        Ref: CheckPresenceCookie
      CheckPresenceHeader:
        Ref: CheckPresenceHeader
      EdgeCacheMode:
        Ref: EdgeCacheMode
      EdgeCacheTtl:
        Ref: EdgeCacheTtl
      EdgeStatusCodeCacheTtl:
        Ref: EdgeStatusCodeCacheTtl
      IncludeCookie:
        Ref: IncludeCookie
      IncludeHeader:
        Ref: IncludeHeader
      QueryString:
        Ref: QueryString
      QueryStringMode:
        Ref: QueryStringMode
      Rule:
        Ref: Rule
      RuleEnable:
        Ref: RuleEnable
      RuleName:
        Ref: RuleName
      Sequence:
        Ref: Sequence
      ServeStale:
        Ref: ServeStale
      SiteId:
        Ref: SiteId
      SiteVersion:
        Ref: SiteVersion
      SortQueryStringForCache:
        Ref: SortQueryStringForCache
      UserDeviceType:
        Ref: UserDeviceType
      UserGeo:
        Ref: UserGeo
      UserLanguage:
        Ref: UserLanguage
Outputs:
  AdditionalCacheablePorts:
    Description: The additional ports on which caching is enabled.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - AdditionalCacheablePorts
  BrowserCacheMode:
    Description: The browser cache mode.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - BrowserCacheMode
  BrowserCacheTtl:
    Description: The browser cache TTL, in seconds.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - BrowserCacheTtl
  BypassCache:
    Description: The caching mode.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - BypassCache
  CacheDeceptionArmor:
    Description: Indicates whether Cache Deception Armor is enabled.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - CacheDeceptionArmor
  CacheReserveEligibility:
    Description: The cache reserve eligibility.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - CacheReserveEligibility
  CacheRuleId:
    Description: The ID of the cache rule.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - CacheRuleId
  CheckPresenceCookie:
    Description: The cookies checked for presence during cache key generation.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - CheckPresenceCookie
  CheckPresenceHeader:
    Description: The headers checked for presence during cache key generation.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - CheckPresenceHeader
  ConfigType:
    Description: The type of the configuration, which can be global or rule-based.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ConfigType
  EdgeCacheMode:
    Description: The edge cache mode.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - EdgeCacheMode
  EdgeCacheTtl:
    Description: The edge cache TTL, in seconds.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - EdgeCacheTtl
  EdgeStatusCodeCacheTtl:
    Description: The cache TTL for specific status codes.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - EdgeStatusCodeCacheTtl
  IncludeCookie:
    Description: The cookies included in the cache key.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - IncludeCookie
  IncludeHeader:
    Description: The headers included in the cache key.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - IncludeHeader
  QueryString:
    Description: The query strings included in or excluded from the cache key.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - QueryString
  QueryStringMode:
    Description: The mode for handling query strings.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - QueryStringMode
  Rule:
    Description: The conditional expression for the rule.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Rule
  RuleEnable:
    Description: Indicates whether the rule is enabled.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - RuleEnable
  RuleName:
    Description: The name of the rule.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - RuleName
  Sequence:
    Description: The execution priority of the rule.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Sequence
  ServeStale:
    Description: Indicates whether Serve Stale is enabled.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ServeStale
  SiteVersion:
    Description: The version of the site configuration.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - SiteVersion
  SortQueryStringForCache:
    Description: Indicates whether query strings in the cache key are sorted.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - SortQueryStringForCache
  UserDeviceType:
    Description: Indicates whether the client's device type is included in the cache key.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - UserDeviceType
  UserGeo:
    Description: Indicates whether the client's geographic location is included in the cache key.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - UserGeo
  UserLanguage:
    Description: Indicates whether the client's language is included in the cache key.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - UserLanguage
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "AdditionalCacheablePorts": {
      "Type": "Number",
      "Description": {
        "en": "Specifies the ports on which to enable caching. Valid values: 8880, 2052, 2082, 2086, 2095, 2053, 2083, 2087, and 2096."
      },
      "AllowedValues": [
        8880,
        2052,
        2082,
        2086,
        2095,
        2053,
        2083,
        2087,
        2096
      ],
      "Required": false
    },
    "BrowserCacheMode": {
      "Type": "String",
      "Description": {
        "en": "Specifies the browser cache mode. Valid values:\n- `no_cache`: Tells the browser not to cache the response.\n- `follow_origin`: Tells the browser to use the origin server's cache policy.\n- `override_origin`: Tells the browser to override the origin server's cache policy."
      },
      "AllowedValues": [
        "no_cache",
        "follow_origin",
        "override_origin"
      ],
      "Required": false
    },
    "BrowserCacheTtl": {
      "Type": "Number",
      "Description": {
        "en": "Specifies the browser cache time-to-live (TTL) in seconds. This sets the `max-age` value in the `Cache-Control` header sent to the browser."
      },
      "Required": false
    },
    "BypassCache": {
      "Type": "String",
      "Description": {
        "en": "Specifies the caching mode. Valid values:\n- `cache_all`: Caches all requests.\n- `bypass_all`: Bypasses the cache for all requests."
      },
      "AllowedValues": [
        "cache_all",
        "bypass_all"
      ],
      "Required": false
    },
    "CacheDeceptionArmor": {
      "Type": "String",
      "Description": {
        "en": "Specifies whether to enable Cache Deception Armor. This feature defends against web cache deception attacks by caching only the content that passes validation. Valid values:\n- `on`: Enabled.\n- `off`: Disabled."
      },
      "AllowedValues": [
        "on",
        "off"
      ],
      "Required": false
    },
    "CacheReserveEligibility": {
      "Type": "String",
      "Description": {
        "en": "Specifies the cache reserve eligibility. This setting controls whether a request that misses the cache is sent to a cache reserve node before it is forwarded to the origin server. Valid values:\n- `bypass_cache_reserve`: The request bypasses the cache reserve.\n- `eligible_for_cache_reserve`: The request is eligible for the cache reserve."
      },
      "AllowedValues": [
        "bypass_cache_reserve",
        "eligible_for_cache_reserve"
      ],
      "Required": false
    },
    "CheckPresenceCookie": {
      "Type": "String",
      "Description": {
        "en": "Specifies one or more cookie names. If a request contains a specified cookie, the cookie's name (case-insensitive) is included in the cache key. Separate multiple cookie names with spaces."
      },
      "Required": false
    },
    "CheckPresenceHeader": {
      "Type": "String",
      "Description": {
        "en": "Specifies one or more header names. If a request contains a specified header, the header's name (case-insensitive) is included in the cache key. Separate multiple header names with spaces."
      },
      "Required": false
    },
    "EdgeCacheMode": {
      "Type": "String",
      "Description": {
        "en": "Specifies the edge cache mode. Valid values:\n- `follow_origin`: Follows the cache policy of the origin server. If no policy is configured on the origin server, the default cache policy is used.\n- `no_cache`: Disables caching for all requests.\n- `override_origin`: Overrides the cache policy of the origin server.\n- `follow_origin_bypass`: Follows the cache policy of the origin server. If no policy is configured on the origin server, requests are not cached."
      },
      "AllowedValues": [
        "follow_origin",
        "no_cache",
        "override_origin",
        "follow_origin_bypass"
      ],
      "Required": false
    },
    "EdgeCacheTtl": {
      "Type": "Number",
      "Description": {
        "en": "The expiration time of the edge cache, in seconds."
      },
      "Required": false
    },
    "EdgeStatusCodeCacheTtl": {
      "Type": "String",
      "Description": {
        "en": "The cache TTL for responses with specific status codes, in seconds. Use commas to separate multiple values. For example: `4xx=999999,5xx=999998`"
      },
      "Required": false
    },
    "IncludeCookie": {
      "Type": "String",
      "Description": {
        "en": "Specifies the cookie names to include in the cache key. Both the name and value of each specified cookie are included. Separate multiple cookie names with spaces."
      },
      "Required": false
    },
    "IncludeHeader": {
      "Type": "String",
      "Description": {
        "en": "Specifies the header names to include in the cache key. Both the name and value of each specified header are included. Separate multiple header names with spaces."
      },
      "Required": false
    },
    "QueryString": {
      "Type": "String",
      "Description": {
        "en": "The query strings to include in or exclude from the cache key. Separate multiple query strings with spaces."
      },
      "Required": false
    },
    "QueryStringMode": {
      "Type": "String",
      "Description": {
        "en": "Specifies how to handle query strings when generating the cache key. Valid values:\n- `ignore_all`: Ignores all query strings.\n- `exclude_query_string`: Excludes the specified query strings.\n- `reserve_all`: Default. Includes all query strings.\n- `include_query_string`: Includes only the specified query strings."
      },
      "AllowedValues": [
        "ignore_all",
        "exclude_query_string",
        "reserve_all",
        "include_query_string"
      ],
      "Required": false
    },
    "Rule": {
      "Type": "String",
      "Description": {
        "en": "The conditional expression used to match requests for this rule. This parameter is not required for a global configuration.\n- To apply the rule to all requests, set the value to `true`.\n- To apply the rule to specific requests, use a custom expression, such as `(http.host eq \\\"video.example.com\\\")`."
      },
      "Required": false
    },
    "RuleEnable": {
      "Type": "String",
      "Description": {
        "en": "Specifies whether to enable the rule. This parameter is not required for a global configuration. Valid values:\n- `on`: Enabled.\n- `off`: Disabled."
      },
      "AllowedValues": [
        "on",
        "off"
      ],
      "Required": false
    },
    "RuleName": {
      "Type": "String",
      "Description": {
        "en": "The name of the rule. This parameter is not required for a global configuration."
      },
      "Required": false
    },
    "Sequence": {
      "Type": "Number",
      "Description": {
        "en": "The execution priority of the rule. A smaller value indicates a higher priority."
      },
      "Required": false
    },
    "ServeStale": {
      "Type": "String",
      "Description": {
        "en": "Specifies whether to enable Serve Stale. If enabled, edge nodes can serve stale (expired) content from the cache when the origin server is unavailable. Valid values:\n- `on`: Enabled.\n- `off`: Disabled."
      },
      "AllowedValues": [
        "on",
        "off"
      ],
      "Required": false
    },
    "SiteId": {
      "Type": "Number",
      "Description": {
        "en": "The ID of the site. You can obtain the site ID by calling the `ListSites` operation."
      },
      "Required": true
    },
    "SiteVersion": {
      "Type": "Number",
      "Description": {
        "en": "The version of the site configuration to which the rule applies. This parameter is used for sites where configuration versioning is enabled. The default value is 0."
      },
      "Required": false
    },
    "SortQueryStringForCache": {
      "Type": "String",
      "Description": {
        "en": "Specifies whether to sort query strings in the cache key. Sorting ensures that URLs with the same query strings in a different order are treated as the same request. By default, this feature is disabled. Valid values:\n- `on`: Enabled.\n- `off`: Disabled."
      },
      "AllowedValues": [
        "on",
        "off"
      ],
      "Required": false
    },
    "UserDeviceType": {
      "Type": "String",
      "Description": {
        "en": "Specifies whether to include the client's device type (such as mobile, desktop, or tablet) in the cache key. Valid values:\n- `on`: Enabled.\n- `off`: Disabled."
      },
      "AllowedValues": [
        "on",
        "off"
      ],
      "Required": false
    },
    "UserGeo": {
      "Type": "String",
      "Description": {
        "en": "Specifies whether to include the client's geographic location in the cache key. Valid values:\n- `on`: Enabled.\n- `off`: Disabled."
      },
      "AllowedValues": [
        "on",
        "off"
      ],
      "Required": false
    },
    "UserLanguage": {
      "Type": "String",
      "Description": {
        "en": "Specifies whether to include the client's language (from the `Accept-Language` header) in the cache key. Valid values:\n- `on`: Enabled.\n- `off`: Disabled."
      },
      "AllowedValues": [
        "on",
        "off"
      ],
      "Required": false
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::ESA::CacheRule",
      "Properties": {
        "AdditionalCacheablePorts": {
          "Ref": "AdditionalCacheablePorts"
        },
        "BrowserCacheMode": {
          "Ref": "BrowserCacheMode"
        },
        "BrowserCacheTtl": {
          "Ref": "BrowserCacheTtl"
        },
        "BypassCache": {
          "Ref": "BypassCache"
        },
        "CacheDeceptionArmor": {
          "Ref": "CacheDeceptionArmor"
        },
        "CacheReserveEligibility": {
          "Ref": "CacheReserveEligibility"
        },
        "CheckPresenceCookie": {
          "Ref": "CheckPresenceCookie"
        },
        "CheckPresenceHeader": {
          "Ref": "CheckPresenceHeader"
        },
        "EdgeCacheMode": {
          "Ref": "EdgeCacheMode"
        },
        "EdgeCacheTtl": {
          "Ref": "EdgeCacheTtl"
        },
        "EdgeStatusCodeCacheTtl": {
          "Ref": "EdgeStatusCodeCacheTtl"
        },
        "IncludeCookie": {
          "Ref": "IncludeCookie"
        },
        "IncludeHeader": {
          "Ref": "IncludeHeader"
        },
        "QueryString": {
          "Ref": "QueryString"
        },
        "QueryStringMode": {
          "Ref": "QueryStringMode"
        },
        "Rule": {
          "Ref": "Rule"
        },
        "RuleEnable": {
          "Ref": "RuleEnable"
        },
        "RuleName": {
          "Ref": "RuleName"
        },
        "Sequence": {
          "Ref": "Sequence"
        },
        "ServeStale": {
          "Ref": "ServeStale"
        },
        "SiteId": {
          "Ref": "SiteId"
        },
        "SiteVersion": {
          "Ref": "SiteVersion"
        },
        "SortQueryStringForCache": {
          "Ref": "SortQueryStringForCache"
        },
        "UserDeviceType": {
          "Ref": "UserDeviceType"
        },
        "UserGeo": {
          "Ref": "UserGeo"
        },
        "UserLanguage": {
          "Ref": "UserLanguage"
        }
      }
    }
  },
  "Outputs": {
    "AdditionalCacheablePorts": {
      "Description": "The additional ports on which caching is enabled.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "AdditionalCacheablePorts"
        ]
      }
    },
    "BrowserCacheMode": {
      "Description": "The browser cache mode.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "BrowserCacheMode"
        ]
      }
    },
    "BrowserCacheTtl": {
      "Description": "The browser cache TTL, in seconds.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "BrowserCacheTtl"
        ]
      }
    },
    "BypassCache": {
      "Description": "The caching mode.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "BypassCache"
        ]
      }
    },
    "CacheDeceptionArmor": {
      "Description": "Indicates whether Cache Deception Armor is enabled.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "CacheDeceptionArmor"
        ]
      }
    },
    "CacheReserveEligibility": {
      "Description": "The cache reserve eligibility.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "CacheReserveEligibility"
        ]
      }
    },
    "CacheRuleId": {
      "Description": "The ID of the cache rule.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "CacheRuleId"
        ]
      }
    },
    "CheckPresenceCookie": {
      "Description": "The cookies checked for presence during cache key generation.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "CheckPresenceCookie"
        ]
      }
    },
    "CheckPresenceHeader": {
      "Description": "The headers checked for presence during cache key generation.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "CheckPresenceHeader"
        ]
      }
    },
    "ConfigType": {
      "Description": "The type of the configuration, which can be global or rule-based.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ConfigType"
        ]
      }
    },
    "EdgeCacheMode": {
      "Description": "The edge cache mode.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "EdgeCacheMode"
        ]
      }
    },
    "EdgeCacheTtl": {
      "Description": "The edge cache TTL, in seconds.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "EdgeCacheTtl"
        ]
      }
    },
    "EdgeStatusCodeCacheTtl": {
      "Description": "The cache TTL for specific status codes.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "EdgeStatusCodeCacheTtl"
        ]
      }
    },
    "IncludeCookie": {
      "Description": "The cookies included in the cache key.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "IncludeCookie"
        ]
      }
    },
    "IncludeHeader": {
      "Description": "The headers included in the cache key.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "IncludeHeader"
        ]
      }
    },
    "QueryString": {
      "Description": "The query strings included in or excluded from the cache key.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "QueryString"
        ]
      }
    },
    "QueryStringMode": {
      "Description": "The mode for handling query strings.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "QueryStringMode"
        ]
      }
    },
    "Rule": {
      "Description": "The conditional expression for the rule.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Rule"
        ]
      }
    },
    "RuleEnable": {
      "Description": "Indicates whether the rule is enabled.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "RuleEnable"
        ]
      }
    },
    "RuleName": {
      "Description": "The name of the rule.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "RuleName"
        ]
      }
    },
    "Sequence": {
      "Description": "The execution priority of the rule.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Sequence"
        ]
      }
    },
    "ServeStale": {
      "Description": "Indicates whether Serve Stale is enabled.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ServeStale"
        ]
      }
    },
    "SiteVersion": {
      "Description": "The version of the site configuration.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "SiteVersion"
        ]
      }
    },
    "SortQueryStringForCache": {
      "Description": "Indicates whether query strings in the cache key are sorted.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "SortQueryStringForCache"
        ]
      }
    },
    "UserDeviceType": {
      "Description": "Indicates whether the client's device type is included in the cache key.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "UserDeviceType"
        ]
      }
    },
    "UserGeo": {
      "Description": "Indicates whether the client's geographic location is included in the cache key.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "UserGeo"
        ]
      }
    },
    "UserLanguage": {
      "Description": "Indicates whether the client's language is included in the cache key.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "UserLanguage"
        ]
      }
    }
  }
}