Skip to content

CacheRuleProps

Properties for defining a CacheRule.

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

Initializer

import com.aliyun.ros.cdk.esa.CacheRuleProps;
CacheRuleProps.builder()
    .siteId(java.lang.Number)
    .siteId(IResolvable)
//  .additionalCacheablePorts(java.lang.Number)
//  .additionalCacheablePorts(IResolvable)
//  .browserCacheMode(java.lang.String)
//  .browserCacheMode(IResolvable)
//  .browserCacheTtl(java.lang.Number)
//  .browserCacheTtl(IResolvable)
//  .bypassCache(java.lang.String)
//  .bypassCache(IResolvable)
//  .cacheDeceptionArmor(java.lang.String)
//  .cacheDeceptionArmor(IResolvable)
//  .cacheReserveEligibility(java.lang.String)
//  .cacheReserveEligibility(IResolvable)
//  .checkPresenceCookie(java.lang.String)
//  .checkPresenceCookie(IResolvable)
//  .checkPresenceHeader(java.lang.String)
//  .checkPresenceHeader(IResolvable)
//  .edgeCacheMode(java.lang.String)
//  .edgeCacheMode(IResolvable)
//  .edgeCacheTtl(java.lang.Number)
//  .edgeCacheTtl(IResolvable)
//  .edgeStatusCodeCacheTtl(java.lang.String)
//  .edgeStatusCodeCacheTtl(IResolvable)
//  .includeCookie(java.lang.String)
//  .includeCookie(IResolvable)
//  .includeHeader(java.lang.String)
//  .includeHeader(IResolvable)
//  .queryString(java.lang.String)
//  .queryString(IResolvable)
//  .queryStringMode(java.lang.String)
//  .queryStringMode(IResolvable)
//  .rule(java.lang.String)
//  .rule(IResolvable)
//  .ruleEnable(java.lang.String)
//  .ruleEnable(IResolvable)
//  .ruleName(java.lang.String)
//  .ruleName(IResolvable)
//  .sequence(java.lang.Number)
//  .sequence(IResolvable)
//  .serveStale(java.lang.String)
//  .serveStale(IResolvable)
//  .siteVersion(java.lang.Number)
//  .siteVersion(IResolvable)
//  .sortQueryStringForCache(java.lang.String)
//  .sortQueryStringForCache(IResolvable)
//  .userDeviceType(java.lang.String)
//  .userDeviceType(IResolvable)
//  .userGeo(java.lang.String)
//  .userGeo(IResolvable)
//  .userLanguage(java.lang.String)
//  .userLanguage(IResolvable)
    .build();

Properties

Name Type Description
siteId java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property siteId: The site ID, which can be obtained by calling the [ListSites] API.
additionalCacheablePorts java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property additionalCacheablePorts: Enable caching on specified ports.
browserCacheMode java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property browserCacheMode: Browser cache mode.
browserCacheTtl java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property browserCacheTtl: Browser cache expiration time in seconds.
bypassCache java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property bypassCache: Set the bypass cache mode.
cacheDeceptionArmor java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property cacheDeceptionArmor: Cache deception protection.
cacheReserveEligibility java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property cacheReserveEligibility: Cache retention eligibility.
checkPresenceCookie java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property checkPresenceCookie: When generating the cache key, check if the cookie exists.
checkPresenceHeader java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property checkPresenceHeader: When generating the cache key, check if the header exists.
edgeCacheMode java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property edgeCacheMode: Edge cache mode.
edgeCacheTtl java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property edgeCacheTtl: Edge cache expiration time in seconds.
edgeStatusCodeCacheTtl java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property edgeStatusCodeCacheTtl: Status code cache expiration time in seconds.
includeCookie java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property includeCookie: When generating the cache key, add the specified cookie names and their values.
includeHeader java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property includeHeader: When generating the cache key, add the specified header names and their values.
queryString java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property queryString: Query strings to be reserved or excluded.
queryStringMode java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property queryStringMode: The processing mode for query strings when generating the cache key.
rule java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property rule: Rule content, using conditional expressions to match user requests.
ruleEnable java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property ruleEnable: Rule switch.
ruleName java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property ruleName: Rule name.
sequence java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property sequence: Order of rule execution.
serveStale java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property serveStale: Serve stale cache.
siteVersion java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property siteVersion: The version number of the site configuration.
sortQueryStringForCache java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property sortQueryStringForCache: Query string sorting, disabled by default.
userDeviceType java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property userDeviceType: When generating the cache key, add the client device type.
userGeo java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property userGeo: When generating the cache key, add the client's geographic location.
userLanguage java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property userLanguage: When generating cache keys, include the client's language type.

siteIdRequired

public java.lang.Object getSiteId();
  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

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


additionalCacheablePortsOptional

public java.lang.Object getAdditionalCacheablePorts();
  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

Property additionalCacheablePorts: Enable caching on specified ports.

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


browserCacheModeOptional

public java.lang.Object getBrowserCacheMode();
  • Type: java.lang.String OR com.aliyun.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.

browserCacheTtlOptional

public java.lang.Object getBrowserCacheTtl();
  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

Property browserCacheTtl: Browser cache expiration time in seconds.


bypassCacheOptional

public java.lang.Object getBypassCache();
  • Type: java.lang.String OR com.aliyun.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.

cacheDeceptionArmorOptional

public java.lang.Object getCacheDeceptionArmor();
  • Type: java.lang.String OR com.aliyun.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.

cacheReserveEligibilityOptional

public java.lang.Object getCacheReserveEligibility();
  • Type: java.lang.String OR com.aliyun.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.

checkPresenceCookieOptional

public java.lang.Object getCheckPresenceCookie();
  • Type: java.lang.String OR com.aliyun.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.


checkPresenceHeaderOptional

public java.lang.Object getCheckPresenceHeader();
  • Type: java.lang.String OR com.aliyun.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.


edgeCacheModeOptional

public java.lang.Object getEdgeCacheMode();
  • Type: java.lang.String OR com.aliyun.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.

edgeCacheTtlOptional

public java.lang.Object getEdgeCacheTtl();
  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

Property edgeCacheTtl: Edge cache expiration time in seconds.


edgeStatusCodeCacheTtlOptional

public java.lang.Object getEdgeStatusCodeCacheTtl();
  • Type: java.lang.String OR com.aliyun.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


includeCookieOptional

public java.lang.Object getIncludeCookie();
  • Type: java.lang.String OR com.aliyun.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.


includeHeaderOptional

public java.lang.Object getIncludeHeader();
  • Type: java.lang.String OR com.aliyun.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.


queryStringOptional

public java.lang.Object getQueryString();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property queryString: Query strings to be reserved or excluded.

Multiple values are supported, separated by spaces.


queryStringModeOptional

public java.lang.Object getQueryStringMode();
  • Type: java.lang.String OR com.aliyun.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

public java.lang.Object getRule();
  • Type: java.lang.String OR com.aliyun.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").

ruleEnableOptional

public java.lang.Object getRuleEnable();
  • Type: java.lang.String OR com.aliyun.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.

ruleNameOptional

public java.lang.Object getRuleName();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property ruleName: Rule name.

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


sequenceOptional

public java.lang.Object getSequence();
  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

Property sequence: Order of rule execution.

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


serveStaleOptional

public java.lang.Object getServeStale();
  • Type: java.lang.String OR com.aliyun.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.

siteVersionOptional

public java.lang.Object getSiteVersion();
  • Type: java.lang.Number OR com.aliyun.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.


sortQueryStringForCacheOptional

public java.lang.Object getSortQueryStringForCache();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property sortQueryStringForCache: Query string sorting, disabled by default.

Possible values:

  • on: Enable.
  • off: Disable.

userDeviceTypeOptional

public java.lang.Object getUserDeviceType();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

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

Possible values:

  • on: Enable.
  • off: Disable.

userGeoOptional

public java.lang.Object getUserGeo();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

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

Possible values:

  • on: Enable.
  • off: Disable.

userLanguageOptional

public java.lang.Object getUserLanguage();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

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

Possible values:

  • on: Enable.
  • off: Disable.