Skip to content

CacheRuleProps

Properties for defining a CacheRule.

See https://www.alibabacloud.com/help/ros/developer-reference/aliyun-esa-cacherule

Initializer

import ros_cdk_esa
ros_cdk_esa.CacheRuleProps(
  site_id: typing.Union[typing.Union[int, float], IResolvable],
  additional_cacheable_ports: typing.Union[typing.Union[int, float], IResolvable] = None,
  browser_cache_mode: typing.Union[str, IResolvable] = None,
  browser_cache_ttl: typing.Union[typing.Union[int, float], IResolvable] = None,
  bypass_cache: typing.Union[str, IResolvable] = None,
  cache_deception_armor: typing.Union[str, IResolvable] = None,
  cache_reserve_eligibility: typing.Union[str, IResolvable] = None,
  check_presence_cookie: typing.Union[str, IResolvable] = None,
  check_presence_header: typing.Union[str, IResolvable] = None,
  edge_cache_mode: typing.Union[str, IResolvable] = None,
  edge_cache_ttl: typing.Union[typing.Union[int, float], IResolvable] = None,
  edge_status_code_cache_ttl: typing.Union[str, IResolvable] = None,
  include_cookie: typing.Union[str, IResolvable] = None,
  include_header: typing.Union[str, IResolvable] = None,
  query_string: typing.Union[str, IResolvable] = None,
  query_string_mode: typing.Union[str, IResolvable] = None,
  rule: typing.Union[str, IResolvable] = None,
  rule_enable: typing.Union[str, IResolvable] = None,
  rule_name: typing.Union[str, IResolvable] = None,
  sequence: typing.Union[typing.Union[int, float], IResolvable] = None,
  serve_stale: typing.Union[str, IResolvable] = None,
  site_version: typing.Union[typing.Union[int, float], IResolvable] = None,
  sort_query_string_for_cache: typing.Union[str, IResolvable] = None,
  user_device_type: typing.Union[str, IResolvable] = None,
  user_geo: typing.Union[str, IResolvable] = None,
  user_language: typing.Union[str, IResolvable] = None
)

Properties

Name Type Description
site_id typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property siteId: The site ID, which can be obtained by calling the [ListSites] API.
additional_cacheable_ports typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property additionalCacheablePorts: Enable caching on specified ports.
browser_cache_mode typing.Union[str, ros_cdk_core.IResolvable] Property browserCacheMode: Browser cache mode.
browser_cache_ttl typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property browserCacheTtl: Browser cache expiration time in seconds.
bypass_cache typing.Union[str, ros_cdk_core.IResolvable] Property bypassCache: Set the bypass cache mode.
cache_deception_armor typing.Union[str, ros_cdk_core.IResolvable] Property cacheDeceptionArmor: Cache deception protection.
cache_reserve_eligibility typing.Union[str, ros_cdk_core.IResolvable] Property cacheReserveEligibility: Cache retention eligibility.
check_presence_cookie typing.Union[str, ros_cdk_core.IResolvable] Property checkPresenceCookie: When generating the cache key, check if the cookie exists.
check_presence_header typing.Union[str, ros_cdk_core.IResolvable] Property checkPresenceHeader: When generating the cache key, check if the header exists.
edge_cache_mode typing.Union[str, ros_cdk_core.IResolvable] Property edgeCacheMode: Edge cache mode.
edge_cache_ttl typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property edgeCacheTtl: Edge cache expiration time in seconds.
edge_status_code_cache_ttl typing.Union[str, ros_cdk_core.IResolvable] Property edgeStatusCodeCacheTtl: Status code cache expiration time in seconds.
include_cookie typing.Union[str, ros_cdk_core.IResolvable] Property includeCookie: When generating the cache key, add the specified cookie names and their values.
include_header typing.Union[str, ros_cdk_core.IResolvable] Property includeHeader: When generating the cache key, add the specified header names and their values.
query_string typing.Union[str, ros_cdk_core.IResolvable] Property queryString: Query strings to be reserved or excluded.
query_string_mode typing.Union[str, ros_cdk_core.IResolvable] Property queryStringMode: The processing mode for query strings when generating the cache key.
rule typing.Union[str, ros_cdk_core.IResolvable] Property rule: Rule content, using conditional expressions to match user requests.
rule_enable typing.Union[str, ros_cdk_core.IResolvable] Property ruleEnable: Rule switch.
rule_name typing.Union[str, ros_cdk_core.IResolvable] Property ruleName: Rule name.
sequence typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property sequence: Order of rule execution.
serve_stale typing.Union[str, ros_cdk_core.IResolvable] Property serveStale: Serve stale cache.
site_version typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property siteVersion: The version number of the site configuration.
sort_query_string_for_cache typing.Union[str, ros_cdk_core.IResolvable] Property sortQueryStringForCache: Query string sorting, disabled by default.
user_device_type typing.Union[str, ros_cdk_core.IResolvable] Property userDeviceType: When generating the cache key, add the client device type.
user_geo typing.Union[str, ros_cdk_core.IResolvable] Property userGeo: When generating the cache key, add the client's geographic location.
user_language typing.Union[str, ros_cdk_core.IResolvable] Property userLanguage: When generating cache keys, include the client's language type.

site_idRequired

site_id: typing.Union[typing.Union[int, float], IResolvable]
  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

Property siteId: The site ID, which can be obtained by calling the [ListSites] API.


additional_cacheable_portsOptional

additional_cacheable_ports: typing.Union[typing.Union[int, float], IResolvable]
  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

Property additionalCacheablePorts: Enable caching on specified ports.

Value range: 8880, 2052, 2082, 2086, 2095, 2053, 2083, 2087, 2096.


browser_cache_modeOptional

browser_cache_mode: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property browserCacheMode: Browser cache mode.

Possible values:

  • no_cacheno_cache: Do not cache.
  • follow_origin: Follow the origin server's cache policy.
  • override_origin: Override the origin server's cache policy.

browser_cache_ttlOptional

browser_cache_ttl: typing.Union[typing.Union[int, float], IResolvable]
  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

Property browserCacheTtl: Browser cache expiration time in seconds.


bypass_cacheOptional

bypass_cache: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property bypassCache: Set the bypass cache mode.

Possible values:

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

cache_deception_armorOptional

cache_deception_armor: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property cacheDeceptionArmor: 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.

cache_reserve_eligibilityOptional

cache_reserve_eligibility: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property cacheReserveEligibility: 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.

check_presence_cookieOptional

check_presence_cookie: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property checkPresenceCookie: 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.


check_presence_headerOptional

check_presence_header: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property checkPresenceHeader: 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.


edge_cache_modeOptional

edge_cache_mode: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property edgeCacheMode: 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.

edge_cache_ttlOptional

edge_cache_ttl: typing.Union[typing.Union[int, float], IResolvable]
  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

Property edgeCacheTtl: Edge cache expiration time in seconds.


edge_status_code_cache_ttlOptional

edge_status_code_cache_ttl: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property edgeStatusCodeCacheTtl: Status code cache expiration time in seconds.

Multiple values are separated by commas, for example: 4xx=999999,5xx=999998


include_cookieOptional

include_cookie: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property includeCookie: When generating the cache key, add the specified cookie names and their values.

Multiple values are supported, separated by spaces.


include_headerOptional

include_header: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property includeHeader: When generating the cache key, add the specified header names and their values.

Multiple values are supported, separated by spaces.


query_stringOptional

query_string: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property queryString: Query strings to be reserved or excluded.

Multiple values are supported, separated by spaces.


query_string_modeOptional

query_string_mode: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property queryStringMode: 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.

ruleOptional

rule: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property rule: 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").

rule_enableOptional

rule_enable: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property ruleEnable: Rule switch.

When adding global configuration, this parameter does not need to be set. Value range:

  • on: open.
  • off: close.

rule_nameOptional

rule_name: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property ruleName: Rule name.

When adding global configuration, this parameter does not need to be set.


sequenceOptional

sequence: typing.Union[typing.Union[int, float], IResolvable]
  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

Property sequence: Order of rule execution.

The smaller the value, the higher the priority for execution.


serve_staleOptional

serve_stale: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property serveStale: 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.

site_versionOptional

site_version: typing.Union[typing.Union[int, float], IResolvable]
  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

Property siteVersion: 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.


sort_query_string_for_cacheOptional

sort_query_string_for_cache: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property sortQueryStringForCache: Query string sorting, disabled by default.

Possible values:

  • on: Enable.
  • off: Disable.

user_device_typeOptional

user_device_type: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property userDeviceType: When generating the cache key, add the client device type.

Possible values:

  • on: Enable.
  • off: Disable.

user_geoOptional

user_geo: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property userGeo: When generating the cache key, add the client's geographic location.

Possible values:

  • on: Enable.
  • off: Disable.

user_languageOptional

user_language: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property userLanguage: When generating cache keys, include the client's language type.

Possible values:

  • on: Enable.
  • off: Disable.