ALIYUN::ESA::CacheRule

更新时间:
复制为 MD 格式

ALIYUN::ESA::CacheRule类型用于添加站点缓存配置。

语法

{
  "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
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

SiteId

Integer

站点ID。

AdditionalCacheablePorts

Integer

在指定端口上启用缓存。

取值:

  • 8880

  • 2052

  • 2082

  • 2086

  • 2095

  • 2053

  • 2083

  • 2087

  • 2096

BrowserCacheMode

String

浏览器缓存模式。

取值:

  • no_cache:不缓存。

  • follow_origin: 遵循源站缓存策略。

  • override_origin: 覆盖源站缓存策略。

BrowserCacheTtl

Integer

浏览器缓存过期时间。

单位为秒。

BypassCache

String

设置绕过缓存模式。

可能值:

  • cache_all: 缓存所有请求。

  • bypass_all: 对所有请求绕过缓存。

CacheDeceptionArmor

String

缓存欺骗防护。

用于防御Web缓存欺骗攻击,只有通过验证的缓存内容才会被缓存。取值范围:

  • on: 已启用。

  • off: 已禁用。

CacheReserveEligibility

String

缓存保留资格。

用于控制用户请求回源时是否绕过缓存保留节点。取值:

  • bypass_cache_reserve: 请求绕过缓存保留。

  • eligible_for_cache_reserve: 符合缓存保留条件。

CheckPresenceCookie

String

生成缓存键时,检查cookie是否存在。

如果存在,则将cookie名称(不区分大小写)添加到缓存键中。支持多个cookie名称,以空格分隔。

CheckPresenceHeader

String

生成缓存键时,检查header是否存在。

如果存在,则将header名称(不区分大小写)添加到缓存键中。支持多个header名称,以空格分隔。

EdgeCacheMode

String

边缘缓存模式。

可能值:

  • follow_origin: 遵循源站缓存策略(如果存在),否则使用默认缓存策略。

  • no_cache: 不缓存。

  • override_origin: 覆盖源站缓存策略。

  • follow_origin_bypass: 遵循源站缓存策略(如果存在),否则不缓存。

EdgeCacheTtl

Integer

边缘缓存过期时间。

单位为秒。

EdgeStatusCodeCacheTtl

String

状态码缓存过期时间。

单位为秒。多个值之间用逗号分隔,例如:4xx=999999,5xx=999998

IncludeCookie

String

生成缓存键时,添加指定的cookie名称及其值。

支持多个值,以空格分隔。

IncludeHeader

String

生成缓存键时,添加指定的header名称及其值。

支持多个值,以空格分隔。

QueryString

String

要保留或排除的查询字符串。

支持多个值,以空格分隔。

QueryStringMode

String

生成缓存键时对查询字符串的处理模式。

可能值:

  • ignore_all: 忽略所有。

  • exclude_query_string: 排除指定的查询字符串。

  • reserve_all: 默认保留所有。

  • include_query_string: 包含指定的查询字符串。

Rule

String

规则内容,使用条件表达式匹配用户请求。

添加全局配置时,无需设置此参数。有两种使用场景:

- 匹配所有传入请求:值设置为true。

- 匹配指定请求:将值设置为自定义表达式,例如: (http.host eq \"video.example.com\").

RuleEnable

String

规则开关。

添加全局配置时,无需设置此参数。取值范围:

  • on: 开启。

  • off`: 关闭。

RuleName

String

规则名称。

添加全局配置时,无需设置此参数。

Sequence

Integer

规则执行顺序。

值越小,执行优先级越高。

ServeStale

String

提供过期缓存。

启用后,当源站不可用时,节点仍可使用过期的缓存文件响应用户请求。取值范围:

  • on: 已启用。

  • off: 已禁用。

SiteVersion

Integer

站点配置的版本号。

对于已启用配置版本管理的站点,可使用此参数指定配置站点的生效版本,默认为版本0。

SortQueryStringForCache

String

查询字符串排序。

默认禁用。可能值:

  • on: 启用。

  • off: 禁用

UserDeviceType

String

生成缓存键时,添加客户端设备类型。

可能值:

  • on: 启用。

  • off: 禁用。

UserGeo

String

生成缓存键时,添加客户端的地理位置。

可能值:

  • on: 启用。

  • off: 禁用。

UserLanguage

String

生成缓存键时,包含客户端的语言类型。

可能值:

  • on: 启用。

  • off: 禁用。

返回值

Fn::GetAtt

  • EdgeCacheTtl:边缘缓存过期时间,单位为秒。

  • EdgeCacheMode:边缘缓存模式。

  • EdgeStatusCodeCacheTtl:状态码缓存过期时间,单位为秒。

  • BrowserCacheMode:浏览器缓存模式。

  • UserGeo:生成缓存键时,添加客户端的地理位置。

  • IncludeCookie:生成缓存键时,添加指定的cookie名称及其值。支持多个值,以空格分隔。

  • BrowserCacheTtl:浏览器缓存过期时间,单位为秒。

  • ConfigType:配置类型,可用于查询全局或基于规则的配置。

  • RuleName:规则名称。添加全局配置时,无需设置此参数。

  • RuleEnable:规则开关。添加全局配置时,无需设置此参数。

  • QueryString:要保留或排除的查询字符串。支持多个值,以空格分隔。

  • QueryStringMode:生成缓存键时对查询字符串的处理模式。

  • Sequence:规则执行顺序。值越小,执行优先级越高。

  • BypassCache:设置绕过缓存模式。

  • CheckPresenceHeader:生成缓存键时,检查header是否存在。如果存在,则将header名称(不区分大小写)添加到缓存键中。支持多个header名称,以空格分隔。

  • SortQueryStringForCache:查询字符串排序,默认禁用。

  • CheckPresenceCookie:生成缓存键时,检查cookie是否存在。如果存在,则将cookie名称(不区分大小写)添加到缓存键中。支持多个cookie名称,以空格分隔。

  • UserDeviceType:生成缓存键时,添加客户端设备类型。

  • AdditionalCacheablePorts:在指定端口上启用缓存。

  • CacheReserveEligibility:缓存保留资格。 用于控制用户请求回源时是否绕过缓存保留节点。

  • Rule:规则内容,使用条件表达式匹配用户请求。添加全局配置时,无需设置此参数。

  • UserLanguage:生成缓存键时,包含客户端的语言类型。

  • CacheDeceptionArmor:缓存欺骗防护。用于防御Web缓存欺骗攻击,只有通过验证的缓存内容才会被缓存。

  • CacheRuleId:缓存规则ID。

  • ServeStale:提供过期缓存。启用后,当源站不可用时,节点仍可使用过期的缓存文件响应用户请求。

  • SiteVersion:站点配置的版本号。对于已启用配置版本管理的站点,可使用此参数指定配置站点的生效版本,默认为版本0。

  • IncludeHeader:生成缓存键时,添加指定的header名称及其值。支持多个值,以空格分隔。

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  EdgeCacheTtl:
    Type: Number
    Description:
      en: Edge cache expiration time in seconds.
    Required: false
  SiteId:
    Type: Number
    Description:
      en: The site ID, which can be obtained by calling the [ListSites] API.
    Required: true
  EdgeCacheMode:
    Type: String
    Description:
      en: |-
        Edge cache mode. Possible values:
        - `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.
    AllowedValues:
      - follow_origin
      - no_cache
      - override_origin
      - follow_origin_bypass
    Required: false
  EdgeStatusCodeCacheTtl:
    Type: String
    Description:
      en: 'Status code cache expiration time in seconds. Multiple values are separated by commas, for example: 4xx=999999,5xx=999998'
    Required: false
  BrowserCacheMode:
    Type: String
    Description:
      en: |-
        Browser cache mode. Possible values:
        - `no_cache`no_cache: Do not cache.
        - `follow_origin`: Follow the origin server's cache policy.
        - `override_origin`: Override the origin server's cache policy.
    AllowedValues:
      - no_cache
      - follow_origin
      - override_origin
    Required: false
  UserGeo:
    Type: String
    Description:
      en: |-
        When generating the cache key, add the client's geographic location. Possible values:
        - `on`: Enable.
        - `off`: Disable.
    AllowedValues:
      - 'on'
      - no_cache
      - 'off'
    Required: false
  IncludeCookie:
    Type: String
    Description:
      en: When generating the cache key, add the specified cookie names and their values. Multiple values are supported, separated by spaces.
    Required: false
  BrowserCacheTtl:
    Type: Number
    Description:
      en: Browser cache expiration time in seconds.
    Required: false
  RuleName:
    Type: String
    Description:
      en: Rule name. When adding global configuration, this parameter does not need to be set.
    Required: false
  RuleEnable:
    Type: String
    Description:
      en: |-
        Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
        - `on`: open.
        - `off`: close.
    AllowedValues:
      - 'on'
      - 'off'
    Required: false
  QueryString:
    Type: String
    Description:
      en: Query strings to be reserved or excluded. Multiple values are supported, separated by spaces.
    Required: false
  QueryStringMode:
    Type: String
    Description:
      en: |-
        The processing mode for query strings when generating the cache key. Possible values:
        - `ignore_all`: Ignore all.
        - `exclude_query_string`: Exclude specified query strings.
        - `reserve_all`: Default, reserve all.
        - `include_query_string`: Include specified query strings.
    AllowedValues:
      - ignore_all
      - exclude_query_string
      - reserve_all
      - include_query_string
    Required: false
  Sequence:
    Type: Number
    Description:
      en: Order of rule execution. The smaller the value, the higher the priority for execution.
    Required: false
  BypassCache:
    Type: String
    Description:
      en: |-
        Set the bypass cache mode. Possible values:
        - `cache_all`: Cache all requests.
        - `bypass_all`: Bypass cache for all requests.
    AllowedValues:
      - cache_all
      - bypass_all
    Required: false
  CheckPresenceHeader:
    Type: String
    Description:
      en: 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.
    Required: false
  SortQueryStringForCache:
    Type: String
    Description:
      en: |-
        Query string sorting, disabled by default. Possible values:
        - `on`: Enable.
        - `off`: Disable.
    AllowedValues:
      - 'on'
      - 'off'
    Required: false
  CheckPresenceCookie:
    Type: String
    Description:
      en: 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.
    Required: false
  UserDeviceType:
    Type: String
    Description:
      en: |-
        When generating the cache key, add the client device type. Possible values:
        - `on`: Enable.
        - `off`: Disable.
    AllowedValues:
      - 'on'
      - 'off'
    Required: false
  AdditionalCacheablePorts:
    Type: Number
    Description:
      en: 'Enable caching on specified ports. Value range: 8880, 2052, 2082, 2086, 2095, 2053, 2083, 2087, 2096.'
    AllowedValues:
      - 8880
      - 2052
      - 2082
      - 2086
      - 2095
      - 2053
      - 2083
      - 2087
      - 2096
    Required: false
  CacheReserveEligibility:
    Type: String
    Description:
      en: |-
        Cache retention eligibility. Used to control whether user requests bypass the cache retention node when returning to the origin. Possible values:
        - `bypass_cache_reserve`: Requests bypass cache retention.
        - `eligible_for_cache_reserve`: Eligible for cache retention.
    AllowedValues:
      - bypass_cache_reserve
      - eligible_for_cache_reserve
    Required: false
  Rule:
    Type: String
    Description:
      en: |-
        Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios:
        - Match all incoming requests: value set to true.
        - Match specified request: Set the value to a custom expression, for example: (http.host eq \"video.example.com\").
    Required: false
  UserLanguage:
    Type: String
    Description:
      en: |-
        When generating cache keys, include the client's language type. Possible values:
        - `on`: Enable.
        - `off`: Disable.
    AllowedValues:
      - 'on'
      - 'off'
    Required: false
  CacheDeceptionArmor:
    Type: String
    Description:
      en: |-
        Cache deception protection. Used to defend against web cache deception attacks, only the cache content that passes the validation will be cached. Value range:
        - `on`: Enabled.
        - `off`: Disabled.
    AllowedValues:
      - 'on'
      - 'off'
    Required: false
  ServeStale:
    Type: String
    Description:
      en: |-
        Serve stale cache. When enabled, the node can still respond to user requests with expired cached files when the origin server is unavailable. Value range:
        - `on`: Enabled.
        - `off`: Disabled.
    AllowedValues:
      - 'on'
      - 'off'
    Required: false
  SiteVersion:
    Type: Number
    Description:
      en: The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
    Required: false
  IncludeHeader:
    Type: String
    Description:
      en: When generating the cache key, add the specified header names and their values. Multiple values are supported, separated by spaces.
    Required: false
Resources:
  ExtensionResource:
    Type: ALIYUN::ESA::CacheRule
    Properties:
      EdgeCacheTtl:
        Ref: EdgeCacheTtl
      SiteId:
        Ref: SiteId
      EdgeCacheMode:
        Ref: EdgeCacheMode
      EdgeStatusCodeCacheTtl:
        Ref: EdgeStatusCodeCacheTtl
      BrowserCacheMode:
        Ref: BrowserCacheMode
      UserGeo:
        Ref: UserGeo
      IncludeCookie:
        Ref: IncludeCookie
      BrowserCacheTtl:
        Ref: BrowserCacheTtl
      RuleName:
        Ref: RuleName
      RuleEnable:
        Ref: RuleEnable
      QueryString:
        Ref: QueryString
      QueryStringMode:
        Ref: QueryStringMode
      Sequence:
        Ref: Sequence
      BypassCache:
        Ref: BypassCache
      CheckPresenceHeader:
        Ref: CheckPresenceHeader
      SortQueryStringForCache:
        Ref: SortQueryStringForCache
      CheckPresenceCookie:
        Ref: CheckPresenceCookie
      UserDeviceType:
        Ref: UserDeviceType
      AdditionalCacheablePorts:
        Ref: AdditionalCacheablePorts
      CacheReserveEligibility:
        Ref: CacheReserveEligibility
      Rule:
        Ref: Rule
      UserLanguage:
        Ref: UserLanguage
      CacheDeceptionArmor:
        Ref: CacheDeceptionArmor
      ServeStale:
        Ref: ServeStale
      SiteVersion:
        Ref: SiteVersion
      IncludeHeader:
        Ref: IncludeHeader
Outputs:
  EdgeCacheTtl:
    Description: Edge cache expiration time in seconds.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - EdgeCacheTtl
  EdgeCacheMode:
    Description: Edge cache mode.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - EdgeCacheMode
  EdgeStatusCodeCacheTtl:
    Description: Status code cache expiration time in seconds.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - EdgeStatusCodeCacheTtl
  BrowserCacheMode:
    Description: Browser cache mode.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - BrowserCacheMode
  UserGeo:
    Description: When generating the cache key, add the client's geographic location.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - UserGeo
  IncludeCookie:
    Description: When generating the cache key, add the specified cookie names and their values. Multiple values are supported, separated by spaces.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - IncludeCookie
  BrowserCacheTtl:
    Description: Browser cache expiration time in seconds.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - BrowserCacheTtl
  ConfigType:
    Description: Configuration type, which can be used to query global or rule-based configurations.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ConfigType
  RuleName:
    Description: Rule name. When adding global configuration, this parameter does not need to be set.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - RuleName
  RuleEnable:
    Description: Rule switch. When adding global configuration, this parameter does not need to be set.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - RuleEnable
  QueryString:
    Description: Query strings to be reserved or excluded. Multiple values are supported, separated by spaces.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - QueryString
  QueryStringMode:
    Description: The processing mode for query strings when generating the cache key.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - QueryStringMode
  Sequence:
    Description: Order of rule execution. The smaller the value, the higher the priority for execution.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Sequence
  BypassCache:
    Description: Set the bypass cache mode.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - BypassCache
  CheckPresenceHeader:
    Description: 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.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - CheckPresenceHeader
  SortQueryStringForCache:
    Description: Query string sorting, disabled by default.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - SortQueryStringForCache
  CheckPresenceCookie:
    Description: 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.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - CheckPresenceCookie
  UserDeviceType:
    Description: When generating the cache key, add the client device type.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - UserDeviceType
  AdditionalCacheablePorts:
    Description: Enable caching on specified ports.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - AdditionalCacheablePorts
  CacheReserveEligibility:
    Description: Cache retention eligibility. Used to control whether user requests bypass the cache retention node when returning to the origin.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - CacheReserveEligibility
  Rule:
    Description: Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Rule
  UserLanguage:
    Description: When generating cache keys, include the client's language type.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - UserLanguage
  CacheDeceptionArmor:
    Description: Cache deception protection. Used to defend against web cache deception attacks, only the cache content that passes the validation will be cached.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - CacheDeceptionArmor
  CacheRuleId:
    Description: Cache Rule Id.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - CacheRuleId
  ServeStale:
    Description: Serve stale cache. When enabled, the node can still respond to user requests with expired cached files when the origin server is unavailable.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ServeStale
  SiteVersion:
    Description: The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - SiteVersion
  IncludeHeader:
    Description: When generating the cache key, add the specified header names and their values. Multiple values are supported, separated by spaces.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - IncludeHeader
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "EdgeCacheTtl": {
      "Type": "Number",
      "Description": {
        "en": "Edge cache expiration time in seconds."
      },
      "Required": false
    },
    "SiteId": {
      "Type": "Number",
      "Description": {
        "en": "The site ID, which can be obtained by calling the [ListSites] API."
      },
      "Required": true
    },
    "EdgeCacheMode": {
      "Type": "String",
      "Description": {
        "en": "Edge cache mode. Possible values:\n- `follow_origin`: Follow the origin server's cache policy (if it exists), otherwise use the default cache policy.\n- `no_cache`: Do not cache.\n- `override_origin`: Override the origin server's cache policy.\n- `follow_origin_bypass`: Follow the origin server's cache policy (if it exists), otherwise do not cache."
      },
      "AllowedValues": [
        "follow_origin",
        "no_cache",
        "override_origin",
        "follow_origin_bypass"
      ],
      "Required": false
    },
    "EdgeStatusCodeCacheTtl": {
      "Type": "String",
      "Description": {
        "en": "Status code cache expiration time in seconds. Multiple values are separated by commas, for example: 4xx=999999,5xx=999998"
      },
      "Required": false
    },
    "BrowserCacheMode": {
      "Type": "String",
      "Description": {
        "en": "Browser cache mode. Possible values:\n- `no_cache`no_cache: Do not cache.\n- `follow_origin`: Follow the origin server's cache policy.\n- `override_origin`: Override the origin server's cache policy."
      },
      "AllowedValues": [
        "no_cache",
        "follow_origin",
        "override_origin"
      ],
      "Required": false
    },
    "UserGeo": {
      "Type": "String",
      "Description": {
        "en": "When generating the cache key, add the client's geographic location. Possible values:\n- `on`: Enable.\n- `off`: Disable."
      },
      "AllowedValues": [
        "on",
        "no_cache",
        "off"
      ],
      "Required": false
    },
    "IncludeCookie": {
      "Type": "String",
      "Description": {
        "en": "When generating the cache key, add the specified cookie names and their values. Multiple values are supported, separated by spaces."
      },
      "Required": false
    },
    "BrowserCacheTtl": {
      "Type": "Number",
      "Description": {
        "en": "Browser cache expiration time in seconds."
      },
      "Required": false
    },
    "RuleName": {
      "Type": "String",
      "Description": {
        "en": "Rule name. When adding global configuration, this parameter does not need to be set."
      },
      "Required": false
    },
    "RuleEnable": {
      "Type": "String",
      "Description": {
        "en": "Rule switch. When adding global configuration, this parameter does not need to be set. Value range:\n- `on`: open.\n- `off`: close."
      },
      "AllowedValues": [
        "on",
        "off"
      ],
      "Required": false
    },
    "QueryString": {
      "Type": "String",
      "Description": {
        "en": "Query strings to be reserved or excluded. Multiple values are supported, separated by spaces."
      },
      "Required": false
    },
    "QueryStringMode": {
      "Type": "String",
      "Description": {
        "en": "The processing mode for query strings when generating the cache key. Possible values:\n- `ignore_all`: Ignore all.\n- `exclude_query_string`: Exclude specified query strings.\n- `reserve_all`: Default, reserve all.\n- `include_query_string`: Include specified query strings."
      },
      "AllowedValues": [
        "ignore_all",
        "exclude_query_string",
        "reserve_all",
        "include_query_string"
      ],
      "Required": false
    },
    "Sequence": {
      "Type": "Number",
      "Description": {
        "en": "Order of rule execution. The smaller the value, the higher the priority for execution."
      },
      "Required": false
    },
    "BypassCache": {
      "Type": "String",
      "Description": {
        "en": "Set the bypass cache mode. Possible values:\n- `cache_all`: Cache all requests.\n- `bypass_all`: Bypass cache for all requests."
      },
      "AllowedValues": [
        "cache_all",
        "bypass_all"
      ],
      "Required": false
    },
    "CheckPresenceHeader": {
      "Type": "String",
      "Description": {
        "en": "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."
      },
      "Required": false
    },
    "SortQueryStringForCache": {
      "Type": "String",
      "Description": {
        "en": "Query string sorting, disabled by default. Possible values:\n- `on`: Enable.\n- `off`: Disable."
      },
      "AllowedValues": [
        "on",
        "off"
      ],
      "Required": false
    },
    "CheckPresenceCookie": {
      "Type": "String",
      "Description": {
        "en": "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."
      },
      "Required": false
    },
    "UserDeviceType": {
      "Type": "String",
      "Description": {
        "en": "When generating the cache key, add the client device type. Possible values:\n- `on`: Enable.\n- `off`: Disable."
      },
      "AllowedValues": [
        "on",
        "off"
      ],
      "Required": false
    },
    "AdditionalCacheablePorts": {
      "Type": "Number",
      "Description": {
        "en": "Enable caching on specified ports. Value range: 8880, 2052, 2082, 2086, 2095, 2053, 2083, 2087, 2096."
      },
      "AllowedValues": [
        8880,
        2052,
        2082,
        2086,
        2095,
        2053,
        2083,
        2087,
        2096
      ],
      "Required": false
    },
    "CacheReserveEligibility": {
      "Type": "String",
      "Description": {
        "en": "Cache retention eligibility. Used to control whether user requests bypass the cache retention node when returning to the origin. Possible values:\n- `bypass_cache_reserve`: Requests bypass cache retention.\n- `eligible_for_cache_reserve`: Eligible for cache retention."
      },
      "AllowedValues": [
        "bypass_cache_reserve",
        "eligible_for_cache_reserve"
      ],
      "Required": false
    },
    "Rule": {
      "Type": "String",
      "Description": {
        "en": "Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios:\n- Match all incoming requests: value set to true.\n- Match specified request: Set the value to a custom expression, for example: (http.host eq \\\"video.example.com\\\")."
      },
      "Required": false
    },
    "UserLanguage": {
      "Type": "String",
      "Description": {
        "en": "When generating cache keys, include the client's language type. Possible values:\n- `on`: Enable.\n- `off`: Disable."
      },
      "AllowedValues": [
        "on",
        "off"
      ],
      "Required": false
    },
    "CacheDeceptionArmor": {
      "Type": "String",
      "Description": {
        "en": "Cache deception protection. Used to defend against web cache deception attacks, only the cache content that passes the validation will be cached. Value range:\n- `on`: Enabled.\n- `off`: Disabled."
      },
      "AllowedValues": [
        "on",
        "off"
      ],
      "Required": false
    },
    "ServeStale": {
      "Type": "String",
      "Description": {
        "en": "Serve stale cache. When enabled, the node can still respond to user requests with expired cached files when the origin server is unavailable. Value range:\n- `on`: Enabled.\n- `off`: Disabled."
      },
      "AllowedValues": [
        "on",
        "off"
      ],
      "Required": false
    },
    "SiteVersion": {
      "Type": "Number",
      "Description": {
        "en": "The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0."
      },
      "Required": false
    },
    "IncludeHeader": {
      "Type": "String",
      "Description": {
        "en": "When generating the cache key, add the specified header names and their values. Multiple values are supported, separated by spaces."
      },
      "Required": false
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::ESA::CacheRule",
      "Properties": {
        "EdgeCacheTtl": {
          "Ref": "EdgeCacheTtl"
        },
        "SiteId": {
          "Ref": "SiteId"
        },
        "EdgeCacheMode": {
          "Ref": "EdgeCacheMode"
        },
        "EdgeStatusCodeCacheTtl": {
          "Ref": "EdgeStatusCodeCacheTtl"
        },
        "BrowserCacheMode": {
          "Ref": "BrowserCacheMode"
        },
        "UserGeo": {
          "Ref": "UserGeo"
        },
        "IncludeCookie": {
          "Ref": "IncludeCookie"
        },
        "BrowserCacheTtl": {
          "Ref": "BrowserCacheTtl"
        },
        "RuleName": {
          "Ref": "RuleName"
        },
        "RuleEnable": {
          "Ref": "RuleEnable"
        },
        "QueryString": {
          "Ref": "QueryString"
        },
        "QueryStringMode": {
          "Ref": "QueryStringMode"
        },
        "Sequence": {
          "Ref": "Sequence"
        },
        "BypassCache": {
          "Ref": "BypassCache"
        },
        "CheckPresenceHeader": {
          "Ref": "CheckPresenceHeader"
        },
        "SortQueryStringForCache": {
          "Ref": "SortQueryStringForCache"
        },
        "CheckPresenceCookie": {
          "Ref": "CheckPresenceCookie"
        },
        "UserDeviceType": {
          "Ref": "UserDeviceType"
        },
        "AdditionalCacheablePorts": {
          "Ref": "AdditionalCacheablePorts"
        },
        "CacheReserveEligibility": {
          "Ref": "CacheReserveEligibility"
        },
        "Rule": {
          "Ref": "Rule"
        },
        "UserLanguage": {
          "Ref": "UserLanguage"
        },
        "CacheDeceptionArmor": {
          "Ref": "CacheDeceptionArmor"
        },
        "ServeStale": {
          "Ref": "ServeStale"
        },
        "SiteVersion": {
          "Ref": "SiteVersion"
        },
        "IncludeHeader": {
          "Ref": "IncludeHeader"
        }
      }
    }
  },
  "Outputs": {
    "EdgeCacheTtl": {
      "Description": "Edge cache expiration time in seconds.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "EdgeCacheTtl"
        ]
      }
    },
    "EdgeCacheMode": {
      "Description": "Edge cache mode.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "EdgeCacheMode"
        ]
      }
    },
    "EdgeStatusCodeCacheTtl": {
      "Description": "Status code cache expiration time in seconds.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "EdgeStatusCodeCacheTtl"
        ]
      }
    },
    "BrowserCacheMode": {
      "Description": "Browser cache mode.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "BrowserCacheMode"
        ]
      }
    },
    "UserGeo": {
      "Description": "When generating the cache key, add the client's geographic location.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "UserGeo"
        ]
      }
    },
    "IncludeCookie": {
      "Description": "When generating the cache key, add the specified cookie names and their values. Multiple values are supported, separated by spaces.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "IncludeCookie"
        ]
      }
    },
    "BrowserCacheTtl": {
      "Description": "Browser cache expiration time in seconds.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "BrowserCacheTtl"
        ]
      }
    },
    "ConfigType": {
      "Description": "Configuration type, which can be used to query global or rule-based configurations.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ConfigType"
        ]
      }
    },
    "RuleName": {
      "Description": "Rule name. When adding global configuration, this parameter does not need to be set.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "RuleName"
        ]
      }
    },
    "RuleEnable": {
      "Description": "Rule switch. When adding global configuration, this parameter does not need to be set.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "RuleEnable"
        ]
      }
    },
    "QueryString": {
      "Description": "Query strings to be reserved or excluded. Multiple values are supported, separated by spaces.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "QueryString"
        ]
      }
    },
    "QueryStringMode": {
      "Description": "The processing mode for query strings when generating the cache key.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "QueryStringMode"
        ]
      }
    },
    "Sequence": {
      "Description": "Order of rule execution. The smaller the value, the higher the priority for execution.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Sequence"
        ]
      }
    },
    "BypassCache": {
      "Description": "Set the bypass cache mode.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "BypassCache"
        ]
      }
    },
    "CheckPresenceHeader": {
      "Description": "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.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "CheckPresenceHeader"
        ]
      }
    },
    "SortQueryStringForCache": {
      "Description": "Query string sorting, disabled by default.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "SortQueryStringForCache"
        ]
      }
    },
    "CheckPresenceCookie": {
      "Description": "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.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "CheckPresenceCookie"
        ]
      }
    },
    "UserDeviceType": {
      "Description": "When generating the cache key, add the client device type.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "UserDeviceType"
        ]
      }
    },
    "AdditionalCacheablePorts": {
      "Description": "Enable caching on specified ports.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "AdditionalCacheablePorts"
        ]
      }
    },
    "CacheReserveEligibility": {
      "Description": "Cache retention eligibility. Used to control whether user requests bypass the cache retention node when returning to the origin.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "CacheReserveEligibility"
        ]
      }
    },
    "Rule": {
      "Description": "Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Rule"
        ]
      }
    },
    "UserLanguage": {
      "Description": "When generating cache keys, include the client's language type.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "UserLanguage"
        ]
      }
    },
    "CacheDeceptionArmor": {
      "Description": "Cache deception protection. Used to defend against web cache deception attacks, only the cache content that passes the validation will be cached.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "CacheDeceptionArmor"
        ]
      }
    },
    "CacheRuleId": {
      "Description": "Cache Rule Id.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "CacheRuleId"
        ]
      }
    },
    "ServeStale": {
      "Description": "Serve stale cache. When enabled, the node can still respond to user requests with expired cached files when the origin server is unavailable.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ServeStale"
        ]
      }
    },
    "SiteVersion": {
      "Description": "The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "SiteVersion"
        ]
      }
    },
    "IncludeHeader": {
      "Description": "When generating the cache key, add the specified header names and their values. Multiple values are supported, separated by spaces.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "IncludeHeader"
        ]
      }
    }
  }
}