Skip to content

CacheRuleProps

Properties for defining a CacheRule.

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

Initializer

using AlibabaCloud.SDK.ROS.CDK.Esa;
new CacheRuleProps {
    object SiteId,
    object AdditionalCacheablePorts = null,
    object BrowserCacheMode = null,
    object BrowserCacheTtl = null,
    object BypassCache = null,
    object CacheDeceptionArmor = null,
    object CacheReserveEligibility = null,
    object CheckPresenceCookie = null,
    object CheckPresenceHeader = null,
    object EdgeCacheMode = null,
    object EdgeCacheTtl = null,
    object EdgeStatusCodeCacheTtl = null,
    object IncludeCookie = null,
    object IncludeHeader = null,
    object QueryString = null,
    object QueryStringMode = null,
    object Rule = null,
    object RuleEnable = null,
    object RuleName = null,
    object Sequence = null,
    object ServeStale = null,
    object SiteVersion = null,
    object SortQueryStringForCache = null,
    object UserDeviceType = null,
    object UserGeo = null,
    object UserLanguage = null
};

Properties

Name Type Description
SiteId object Property siteId: The site ID, which can be obtained by calling the [ListSites] API.
AdditionalCacheablePorts object Property additionalCacheablePorts: Enable caching on specified ports.
BrowserCacheMode object Property browserCacheMode: Browser cache mode.
BrowserCacheTtl object Property browserCacheTtl: Browser cache expiration time in seconds.
BypassCache object Property bypassCache: Set the bypass cache mode.
CacheDeceptionArmor object Property cacheDeceptionArmor: Cache deception protection.
CacheReserveEligibility object Property cacheReserveEligibility: Cache retention eligibility.
CheckPresenceCookie object Property checkPresenceCookie: When generating the cache key, check if the cookie exists.
CheckPresenceHeader object Property checkPresenceHeader: When generating the cache key, check if the header exists.
EdgeCacheMode object Property edgeCacheMode: Edge cache mode.
EdgeCacheTtl object Property edgeCacheTtl: Edge cache expiration time in seconds.
EdgeStatusCodeCacheTtl object Property edgeStatusCodeCacheTtl: Status code cache expiration time in seconds.
IncludeCookie object Property includeCookie: When generating the cache key, add the specified cookie names and their values.
IncludeHeader object Property includeHeader: When generating the cache key, add the specified header names and their values.
QueryString object Property queryString: Query strings to be reserved or excluded.
QueryStringMode object Property queryStringMode: The processing mode for query strings when generating the cache key.
Rule object Property rule: Rule content, using conditional expressions to match user requests.
RuleEnable object Property ruleEnable: Rule switch.
RuleName object Property ruleName: Rule name.
Sequence object Property sequence: Order of rule execution.
ServeStale object Property serveStale: Serve stale cache.
SiteVersion object Property siteVersion: The version number of the site configuration.
SortQueryStringForCache object Property sortQueryStringForCache: Query string sorting, disabled by default.
UserDeviceType object Property userDeviceType: When generating the cache key, add the client device type.
UserGeo object Property userGeo: When generating the cache key, add the client's geographic location.
UserLanguage object Property userLanguage: When generating cache keys, include the client's language type.

SiteIdRequired

public object SiteId { get; set; }
  • Type: object

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


AdditionalCacheablePortsOptional

public object AdditionalCacheablePorts { get; set; }
  • Type: object

Property additionalCacheablePorts: Enable caching on specified ports.

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


BrowserCacheModeOptional

public object BrowserCacheMode { get; set; }
  • Type: object

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.

BrowserCacheTtlOptional

public object BrowserCacheTtl { get; set; }
  • Type: object

Property browserCacheTtl: Browser cache expiration time in seconds.


BypassCacheOptional

public object BypassCache { get; set; }
  • Type: object

Property bypassCache: Set the bypass cache mode.

Possible values:

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

CacheDeceptionArmorOptional

public object CacheDeceptionArmor { get; set; }
  • Type: object

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.

CacheReserveEligibilityOptional

public object CacheReserveEligibility { get; set; }
  • Type: object

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.

CheckPresenceCookieOptional

public object CheckPresenceCookie { get; set; }
  • Type: object

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.


CheckPresenceHeaderOptional

public object CheckPresenceHeader { get; set; }
  • Type: object

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.


EdgeCacheModeOptional

public object EdgeCacheMode { get; set; }
  • Type: object

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.

EdgeCacheTtlOptional

public object EdgeCacheTtl { get; set; }
  • Type: object

Property edgeCacheTtl: Edge cache expiration time in seconds.


EdgeStatusCodeCacheTtlOptional

public object EdgeStatusCodeCacheTtl { get; set; }
  • Type: object

Property edgeStatusCodeCacheTtl: Status code cache expiration time in seconds.

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


IncludeCookieOptional

public object IncludeCookie { get; set; }
  • Type: object

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

Multiple values are supported, separated by spaces.


IncludeHeaderOptional

public object IncludeHeader { get; set; }
  • Type: object

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

Multiple values are supported, separated by spaces.


QueryStringOptional

public object QueryString { get; set; }
  • Type: object

Property queryString: Query strings to be reserved or excluded.

Multiple values are supported, separated by spaces.


QueryStringModeOptional

public object QueryStringMode { get; set; }
  • Type: object

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

public object Rule { get; set; }
  • Type: object

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").

RuleEnableOptional

public object RuleEnable { get; set; }
  • Type: object

Property ruleEnable: Rule switch.

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

  • on: open.
  • off: close.

RuleNameOptional

public object RuleName { get; set; }
  • Type: object

Property ruleName: Rule name.

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


SequenceOptional

public object Sequence { get; set; }
  • Type: object

Property sequence: Order of rule execution.

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


ServeStaleOptional

public object ServeStale { get; set; }
  • Type: object

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.

SiteVersionOptional

public object SiteVersion { get; set; }
  • Type: object

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.


SortQueryStringForCacheOptional

public object SortQueryStringForCache { get; set; }
  • Type: object

Property sortQueryStringForCache: Query string sorting, disabled by default.

Possible values:

  • on: Enable.
  • off: Disable.

UserDeviceTypeOptional

public object UserDeviceType { get; set; }
  • Type: object

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

Possible values:

  • on: Enable.
  • off: Disable.

UserGeoOptional

public object UserGeo { get; set; }
  • Type: object

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

Possible values:

  • on: Enable.
  • off: Disable.

UserLanguageOptional

public object UserLanguage { get; set; }
  • Type: object

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

Possible values:

  • on: Enable.
  • off: Disable.