1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. esa
  5. CacheRule
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.esa.CacheRule

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

    Provides a ESA Cache Rule resource.

    For information about ESA Cache Rule and how to use it, see What is Cache Rule.

    NOTE: Available since v1.244.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const _default = alicloud.esa.getSites({
        planSubscribeType: "enterpriseplan",
    });
    const defaultCacheRule = new alicloud.esa.CacheRule("default", {
        userDeviceType: "off",
        browserCacheMode: "no_cache",
        userLanguage: "off",
        checkPresenceHeader: "headername",
        includeCookie: "cookie_exapmle",
        edgeCacheMode: "follow_origin",
        additionalCacheablePorts: "2053",
        ruleName: "rule_example",
        edgeStatusCodeCacheTtl: "300",
        browserCacheTtl: "300",
        queryString: "example",
        userGeo: "off",
        sortQueryStringForCache: "off",
        checkPresenceCookie: "cookiename",
        cacheReserveEligibility: "bypass_cache_reserve",
        queryStringMode: "ignore_all",
        rule: "http.host eq \"video.example.com\"",
        cacheDeceptionArmor: "off",
        siteId: _default.then(_default => _default.sites?.[0]?.id),
        bypassCache: "cache_all",
        edgeCacheTtl: "300",
        ruleEnable: "off",
        siteVersion: 0,
        includeHeader: "example",
        serveStale: "off",
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.esa.get_sites(plan_subscribe_type="enterpriseplan")
    default_cache_rule = alicloud.esa.CacheRule("default",
        user_device_type="off",
        browser_cache_mode="no_cache",
        user_language="off",
        check_presence_header="headername",
        include_cookie="cookie_exapmle",
        edge_cache_mode="follow_origin",
        additional_cacheable_ports="2053",
        rule_name="rule_example",
        edge_status_code_cache_ttl="300",
        browser_cache_ttl="300",
        query_string="example",
        user_geo="off",
        sort_query_string_for_cache="off",
        check_presence_cookie="cookiename",
        cache_reserve_eligibility="bypass_cache_reserve",
        query_string_mode="ignore_all",
        rule="http.host eq \"video.example.com\"",
        cache_deception_armor="off",
        site_id=default.sites[0].id,
        bypass_cache="cache_all",
        edge_cache_ttl="300",
        rule_enable="off",
        site_version=0,
        include_header="example",
        serve_stale="off")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/esa"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_default, err := esa.GetSites(ctx, &esa.GetSitesArgs{
    			PlanSubscribeType: pulumi.StringRef("enterpriseplan"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = esa.NewCacheRule(ctx, "default", &esa.CacheRuleArgs{
    			UserDeviceType:           pulumi.String("off"),
    			BrowserCacheMode:         pulumi.String("no_cache"),
    			UserLanguage:             pulumi.String("off"),
    			CheckPresenceHeader:      pulumi.String("headername"),
    			IncludeCookie:            pulumi.String("cookie_exapmle"),
    			EdgeCacheMode:            pulumi.String("follow_origin"),
    			AdditionalCacheablePorts: pulumi.String("2053"),
    			RuleName:                 pulumi.String("rule_example"),
    			EdgeStatusCodeCacheTtl:   pulumi.String("300"),
    			BrowserCacheTtl:          pulumi.String("300"),
    			QueryString:              pulumi.String("example"),
    			UserGeo:                  pulumi.String("off"),
    			SortQueryStringForCache:  pulumi.String("off"),
    			CheckPresenceCookie:      pulumi.String("cookiename"),
    			CacheReserveEligibility:  pulumi.String("bypass_cache_reserve"),
    			QueryStringMode:          pulumi.String("ignore_all"),
    			Rule:                     pulumi.String("http.host eq \"video.example.com\""),
    			CacheDeceptionArmor:      pulumi.String("off"),
    			SiteId:                   pulumi.Int(_default.Sites[0].Id),
    			BypassCache:              pulumi.String("cache_all"),
    			EdgeCacheTtl:             pulumi.String("300"),
    			RuleEnable:               pulumi.String("off"),
    			SiteVersion:              pulumi.Int(0),
    			IncludeHeader:            pulumi.String("example"),
    			ServeStale:               pulumi.String("off"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = AliCloud.Esa.GetSites.Invoke(new()
        {
            PlanSubscribeType = "enterpriseplan",
        });
    
        var defaultCacheRule = new AliCloud.Esa.CacheRule("default", new()
        {
            UserDeviceType = "off",
            BrowserCacheMode = "no_cache",
            UserLanguage = "off",
            CheckPresenceHeader = "headername",
            IncludeCookie = "cookie_exapmle",
            EdgeCacheMode = "follow_origin",
            AdditionalCacheablePorts = "2053",
            RuleName = "rule_example",
            EdgeStatusCodeCacheTtl = "300",
            BrowserCacheTtl = "300",
            QueryString = "example",
            UserGeo = "off",
            SortQueryStringForCache = "off",
            CheckPresenceCookie = "cookiename",
            CacheReserveEligibility = "bypass_cache_reserve",
            QueryStringMode = "ignore_all",
            Rule = "http.host eq \"video.example.com\"",
            CacheDeceptionArmor = "off",
            SiteId = @default.Apply(@default => @default.Apply(getSitesResult => getSitesResult.Sites[0]?.Id)),
            BypassCache = "cache_all",
            EdgeCacheTtl = "300",
            RuleEnable = "off",
            SiteVersion = 0,
            IncludeHeader = "example",
            ServeStale = "off",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.esa.EsaFunctions;
    import com.pulumi.alicloud.esa.inputs.GetSitesArgs;
    import com.pulumi.alicloud.esa.CacheRule;
    import com.pulumi.alicloud.esa.CacheRuleArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var default = EsaFunctions.getSites(GetSitesArgs.builder()
                .planSubscribeType("enterpriseplan")
                .build());
    
            var defaultCacheRule = new CacheRule("defaultCacheRule", CacheRuleArgs.builder()
                .userDeviceType("off")
                .browserCacheMode("no_cache")
                .userLanguage("off")
                .checkPresenceHeader("headername")
                .includeCookie("cookie_exapmle")
                .edgeCacheMode("follow_origin")
                .additionalCacheablePorts("2053")
                .ruleName("rule_example")
                .edgeStatusCodeCacheTtl("300")
                .browserCacheTtl("300")
                .queryString("example")
                .userGeo("off")
                .sortQueryStringForCache("off")
                .checkPresenceCookie("cookiename")
                .cacheReserveEligibility("bypass_cache_reserve")
                .queryStringMode("ignore_all")
                .rule("http.host eq \"video.example.com\"")
                .cacheDeceptionArmor("off")
                .siteId(default_.sites()[0].id())
                .bypassCache("cache_all")
                .edgeCacheTtl("300")
                .ruleEnable("off")
                .siteVersion("0")
                .includeHeader("example")
                .serveStale("off")
                .build());
    
        }
    }
    
    resources:
      defaultCacheRule:
        type: alicloud:esa:CacheRule
        name: default
        properties:
          userDeviceType: off
          browserCacheMode: no_cache
          userLanguage: off
          checkPresenceHeader: headername
          includeCookie: cookie_exapmle
          edgeCacheMode: follow_origin
          additionalCacheablePorts: '2053'
          ruleName: rule_example
          edgeStatusCodeCacheTtl: '300'
          browserCacheTtl: '300'
          queryString: example
          userGeo: off
          sortQueryStringForCache: off
          checkPresenceCookie: cookiename
          cacheReserveEligibility: bypass_cache_reserve
          queryStringMode: ignore_all
          rule: http.host eq "video.example.com"
          cacheDeceptionArmor: off
          siteId: ${default.sites[0].id}
          bypassCache: cache_all
          edgeCacheTtl: '300'
          ruleEnable: off
          siteVersion: '0'
          includeHeader: example
          serveStale: off
    variables:
      default:
        fn::invoke:
          function: alicloud:esa:getSites
          arguments:
            planSubscribeType: enterpriseplan
    

    Create CacheRule Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new CacheRule(name: string, args: CacheRuleArgs, opts?: CustomResourceOptions);
    @overload
    def CacheRule(resource_name: str,
                  args: CacheRuleArgs,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def CacheRule(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  site_id: Optional[int] = None,
                  include_header: Optional[str] = None,
                  check_presence_header: Optional[str] = None,
                  bypass_cache: Optional[str] = None,
                  cache_deception_armor: Optional[str] = None,
                  cache_reserve_eligibility: Optional[str] = None,
                  check_presence_cookie: Optional[str] = None,
                  additional_cacheable_ports: Optional[str] = None,
                  edge_cache_mode: Optional[str] = None,
                  edge_cache_ttl: Optional[str] = None,
                  edge_status_code_cache_ttl: Optional[str] = None,
                  browser_cache_ttl: Optional[str] = None,
                  include_cookie: Optional[str] = None,
                  rule_name: Optional[str] = None,
                  query_string_mode: Optional[str] = None,
                  rule: Optional[str] = None,
                  rule_enable: Optional[str] = None,
                  query_string: Optional[str] = None,
                  serve_stale: Optional[str] = None,
                  browser_cache_mode: Optional[str] = None,
                  site_version: Optional[int] = None,
                  sort_query_string_for_cache: Optional[str] = None,
                  user_device_type: Optional[str] = None,
                  user_geo: Optional[str] = None,
                  user_language: Optional[str] = None)
    func NewCacheRule(ctx *Context, name string, args CacheRuleArgs, opts ...ResourceOption) (*CacheRule, error)
    public CacheRule(string name, CacheRuleArgs args, CustomResourceOptions? opts = null)
    public CacheRule(String name, CacheRuleArgs args)
    public CacheRule(String name, CacheRuleArgs args, CustomResourceOptions options)
    
    type: alicloud:esa:CacheRule
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args CacheRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args CacheRuleArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args CacheRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CacheRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CacheRuleArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var cacheRuleResource = new AliCloud.Esa.CacheRule("cacheRuleResource", new()
    {
        SiteId = 0,
        IncludeHeader = "string",
        CheckPresenceHeader = "string",
        BypassCache = "string",
        CacheDeceptionArmor = "string",
        CacheReserveEligibility = "string",
        CheckPresenceCookie = "string",
        AdditionalCacheablePorts = "string",
        EdgeCacheMode = "string",
        EdgeCacheTtl = "string",
        EdgeStatusCodeCacheTtl = "string",
        BrowserCacheTtl = "string",
        IncludeCookie = "string",
        RuleName = "string",
        QueryStringMode = "string",
        Rule = "string",
        RuleEnable = "string",
        QueryString = "string",
        ServeStale = "string",
        BrowserCacheMode = "string",
        SiteVersion = 0,
        SortQueryStringForCache = "string",
        UserDeviceType = "string",
        UserGeo = "string",
        UserLanguage = "string",
    });
    
    example, err := esa.NewCacheRule(ctx, "cacheRuleResource", &esa.CacheRuleArgs{
    	SiteId:                   pulumi.Int(0),
    	IncludeHeader:            pulumi.String("string"),
    	CheckPresenceHeader:      pulumi.String("string"),
    	BypassCache:              pulumi.String("string"),
    	CacheDeceptionArmor:      pulumi.String("string"),
    	CacheReserveEligibility:  pulumi.String("string"),
    	CheckPresenceCookie:      pulumi.String("string"),
    	AdditionalCacheablePorts: pulumi.String("string"),
    	EdgeCacheMode:            pulumi.String("string"),
    	EdgeCacheTtl:             pulumi.String("string"),
    	EdgeStatusCodeCacheTtl:   pulumi.String("string"),
    	BrowserCacheTtl:          pulumi.String("string"),
    	IncludeCookie:            pulumi.String("string"),
    	RuleName:                 pulumi.String("string"),
    	QueryStringMode:          pulumi.String("string"),
    	Rule:                     pulumi.String("string"),
    	RuleEnable:               pulumi.String("string"),
    	QueryString:              pulumi.String("string"),
    	ServeStale:               pulumi.String("string"),
    	BrowserCacheMode:         pulumi.String("string"),
    	SiteVersion:              pulumi.Int(0),
    	SortQueryStringForCache:  pulumi.String("string"),
    	UserDeviceType:           pulumi.String("string"),
    	UserGeo:                  pulumi.String("string"),
    	UserLanguage:             pulumi.String("string"),
    })
    
    var cacheRuleResource = new CacheRule("cacheRuleResource", CacheRuleArgs.builder()
        .siteId(0)
        .includeHeader("string")
        .checkPresenceHeader("string")
        .bypassCache("string")
        .cacheDeceptionArmor("string")
        .cacheReserveEligibility("string")
        .checkPresenceCookie("string")
        .additionalCacheablePorts("string")
        .edgeCacheMode("string")
        .edgeCacheTtl("string")
        .edgeStatusCodeCacheTtl("string")
        .browserCacheTtl("string")
        .includeCookie("string")
        .ruleName("string")
        .queryStringMode("string")
        .rule("string")
        .ruleEnable("string")
        .queryString("string")
        .serveStale("string")
        .browserCacheMode("string")
        .siteVersion(0)
        .sortQueryStringForCache("string")
        .userDeviceType("string")
        .userGeo("string")
        .userLanguage("string")
        .build());
    
    cache_rule_resource = alicloud.esa.CacheRule("cacheRuleResource",
        site_id=0,
        include_header="string",
        check_presence_header="string",
        bypass_cache="string",
        cache_deception_armor="string",
        cache_reserve_eligibility="string",
        check_presence_cookie="string",
        additional_cacheable_ports="string",
        edge_cache_mode="string",
        edge_cache_ttl="string",
        edge_status_code_cache_ttl="string",
        browser_cache_ttl="string",
        include_cookie="string",
        rule_name="string",
        query_string_mode="string",
        rule="string",
        rule_enable="string",
        query_string="string",
        serve_stale="string",
        browser_cache_mode="string",
        site_version=0,
        sort_query_string_for_cache="string",
        user_device_type="string",
        user_geo="string",
        user_language="string")
    
    const cacheRuleResource = new alicloud.esa.CacheRule("cacheRuleResource", {
        siteId: 0,
        includeHeader: "string",
        checkPresenceHeader: "string",
        bypassCache: "string",
        cacheDeceptionArmor: "string",
        cacheReserveEligibility: "string",
        checkPresenceCookie: "string",
        additionalCacheablePorts: "string",
        edgeCacheMode: "string",
        edgeCacheTtl: "string",
        edgeStatusCodeCacheTtl: "string",
        browserCacheTtl: "string",
        includeCookie: "string",
        ruleName: "string",
        queryStringMode: "string",
        rule: "string",
        ruleEnable: "string",
        queryString: "string",
        serveStale: "string",
        browserCacheMode: "string",
        siteVersion: 0,
        sortQueryStringForCache: "string",
        userDeviceType: "string",
        userGeo: "string",
        userLanguage: "string",
    });
    
    type: alicloud:esa:CacheRule
    properties:
        additionalCacheablePorts: string
        browserCacheMode: string
        browserCacheTtl: string
        bypassCache: string
        cacheDeceptionArmor: string
        cacheReserveEligibility: string
        checkPresenceCookie: string
        checkPresenceHeader: string
        edgeCacheMode: string
        edgeCacheTtl: string
        edgeStatusCodeCacheTtl: string
        includeCookie: string
        includeHeader: string
        queryString: string
        queryStringMode: string
        rule: string
        ruleEnable: string
        ruleName: string
        serveStale: string
        siteId: 0
        siteVersion: 0
        sortQueryStringForCache: string
        userDeviceType: string
        userGeo: string
        userLanguage: string
    

    CacheRule Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The CacheRule resource accepts the following input properties:

    SiteId int
    The site ID, which can be obtained by calling the [ListSites] API.
    AdditionalCacheablePorts string
    Enable caching on specified ports. Value range: 8880, 2052, 2082, 2086, 2095, 2053, 2083, 2087, 2096
    BrowserCacheMode string
    Browser cache mode. Possible values:
    BrowserCacheTtl string
    Browser cache expiration time in seconds.
    BypassCache string
    Set the bypass cache mode. Possible values:
    CacheDeceptionArmor string
    Cache deception protection. Used to defend against web cache deception attacks, only the cache content that passes the validation will be cached. Value range:
    CacheReserveEligibility string
    Cache retention eligibility. Used to control whether user requests bypass the cache retention node when returning to the origin. Possible values:
    CheckPresenceCookie string
    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.
    CheckPresenceHeader string
    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.
    EdgeCacheMode string
    Edge cache mode. Possible values:
    EdgeCacheTtl string
    Edge cache expiration time in seconds.
    EdgeStatusCodeCacheTtl string
    Status code cache expiration time in seconds.
    IncludeCookie string
    When generating the cache key, add the specified cookie names and their values. Multiple values are supported, separated by spaces.
    IncludeHeader string
    When generating the cache key, add the specified header names and their values. Multiple values are supported, separated by spaces.
    QueryString string
    Query strings to be reserved or excluded. Multiple values are supported, separated by spaces.
    QueryStringMode string
    The processing mode for query strings when generating the cache key. Possible values:
    Rule string
    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").
    RuleEnable string
    Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
    RuleName string
    Rule name. When adding global configuration, this parameter does not need to be set.
    ServeStale string
    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:
    SiteVersion int
    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.
    SortQueryStringForCache string
    Query string sorting, disabled by default. Possible values:
    UserDeviceType string
    When generating the cache key, add the client device type. Possible values:
    UserGeo string
    When generating the cache key, add the client's geographic location. Possible values:
    UserLanguage string
    When generating cache keys, include the client's language type. Possible values:
    SiteId int
    The site ID, which can be obtained by calling the [ListSites] API.
    AdditionalCacheablePorts string
    Enable caching on specified ports. Value range: 8880, 2052, 2082, 2086, 2095, 2053, 2083, 2087, 2096
    BrowserCacheMode string
    Browser cache mode. Possible values:
    BrowserCacheTtl string
    Browser cache expiration time in seconds.
    BypassCache string
    Set the bypass cache mode. Possible values:
    CacheDeceptionArmor string
    Cache deception protection. Used to defend against web cache deception attacks, only the cache content that passes the validation will be cached. Value range:
    CacheReserveEligibility string
    Cache retention eligibility. Used to control whether user requests bypass the cache retention node when returning to the origin. Possible values:
    CheckPresenceCookie string
    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.
    CheckPresenceHeader string
    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.
    EdgeCacheMode string
    Edge cache mode. Possible values:
    EdgeCacheTtl string
    Edge cache expiration time in seconds.
    EdgeStatusCodeCacheTtl string
    Status code cache expiration time in seconds.
    IncludeCookie string
    When generating the cache key, add the specified cookie names and their values. Multiple values are supported, separated by spaces.
    IncludeHeader string
    When generating the cache key, add the specified header names and their values. Multiple values are supported, separated by spaces.
    QueryString string
    Query strings to be reserved or excluded. Multiple values are supported, separated by spaces.
    QueryStringMode string
    The processing mode for query strings when generating the cache key. Possible values:
    Rule string
    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").
    RuleEnable string
    Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
    RuleName string
    Rule name. When adding global configuration, this parameter does not need to be set.
    ServeStale string
    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:
    SiteVersion int
    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.
    SortQueryStringForCache string
    Query string sorting, disabled by default. Possible values:
    UserDeviceType string
    When generating the cache key, add the client device type. Possible values:
    UserGeo string
    When generating the cache key, add the client's geographic location. Possible values:
    UserLanguage string
    When generating cache keys, include the client's language type. Possible values:
    siteId Integer
    The site ID, which can be obtained by calling the [ListSites] API.
    additionalCacheablePorts String
    Enable caching on specified ports. Value range: 8880, 2052, 2082, 2086, 2095, 2053, 2083, 2087, 2096
    browserCacheMode String
    Browser cache mode. Possible values:
    browserCacheTtl String
    Browser cache expiration time in seconds.
    bypassCache String
    Set the bypass cache mode. Possible values:
    cacheDeceptionArmor String
    Cache deception protection. Used to defend against web cache deception attacks, only the cache content that passes the validation will be cached. Value range:
    cacheReserveEligibility String
    Cache retention eligibility. Used to control whether user requests bypass the cache retention node when returning to the origin. Possible values:
    checkPresenceCookie String
    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.
    checkPresenceHeader String
    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.
    edgeCacheMode String
    Edge cache mode. Possible values:
    edgeCacheTtl String
    Edge cache expiration time in seconds.
    edgeStatusCodeCacheTtl String
    Status code cache expiration time in seconds.
    includeCookie String
    When generating the cache key, add the specified cookie names and their values. Multiple values are supported, separated by spaces.
    includeHeader String
    When generating the cache key, add the specified header names and their values. Multiple values are supported, separated by spaces.
    queryString String
    Query strings to be reserved or excluded. Multiple values are supported, separated by spaces.
    queryStringMode String
    The processing mode for query strings when generating the cache key. Possible values:
    rule String
    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").
    ruleEnable String
    Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
    ruleName String
    Rule name. When adding global configuration, this parameter does not need to be set.
    serveStale String
    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:
    siteVersion Integer
    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.
    sortQueryStringForCache String
    Query string sorting, disabled by default. Possible values:
    userDeviceType String
    When generating the cache key, add the client device type. Possible values:
    userGeo String
    When generating the cache key, add the client's geographic location. Possible values:
    userLanguage String
    When generating cache keys, include the client's language type. Possible values:
    siteId number
    The site ID, which can be obtained by calling the [ListSites] API.
    additionalCacheablePorts string
    Enable caching on specified ports. Value range: 8880, 2052, 2082, 2086, 2095, 2053, 2083, 2087, 2096
    browserCacheMode string
    Browser cache mode. Possible values:
    browserCacheTtl string
    Browser cache expiration time in seconds.
    bypassCache string
    Set the bypass cache mode. Possible values:
    cacheDeceptionArmor string
    Cache deception protection. Used to defend against web cache deception attacks, only the cache content that passes the validation will be cached. Value range:
    cacheReserveEligibility string
    Cache retention eligibility. Used to control whether user requests bypass the cache retention node when returning to the origin. Possible values:
    checkPresenceCookie string
    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.
    checkPresenceHeader string
    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.
    edgeCacheMode string
    Edge cache mode. Possible values:
    edgeCacheTtl string
    Edge cache expiration time in seconds.
    edgeStatusCodeCacheTtl string
    Status code cache expiration time in seconds.
    includeCookie string
    When generating the cache key, add the specified cookie names and their values. Multiple values are supported, separated by spaces.
    includeHeader string
    When generating the cache key, add the specified header names and their values. Multiple values are supported, separated by spaces.
    queryString string
    Query strings to be reserved or excluded. Multiple values are supported, separated by spaces.
    queryStringMode string
    The processing mode for query strings when generating the cache key. Possible values:
    rule string
    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").
    ruleEnable string
    Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
    ruleName string
    Rule name. When adding global configuration, this parameter does not need to be set.
    serveStale string
    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:
    siteVersion number
    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.
    sortQueryStringForCache string
    Query string sorting, disabled by default. Possible values:
    userDeviceType string
    When generating the cache key, add the client device type. Possible values:
    userGeo string
    When generating the cache key, add the client's geographic location. Possible values:
    userLanguage string
    When generating cache keys, include the client's language type. Possible values:
    site_id int
    The site ID, which can be obtained by calling the [ListSites] API.
    additional_cacheable_ports str
    Enable caching on specified ports. Value range: 8880, 2052, 2082, 2086, 2095, 2053, 2083, 2087, 2096
    browser_cache_mode str
    Browser cache mode. Possible values:
    browser_cache_ttl str
    Browser cache expiration time in seconds.
    bypass_cache str
    Set the bypass cache mode. Possible values:
    cache_deception_armor str
    Cache deception protection. Used to defend against web cache deception attacks, only the cache content that passes the validation will be cached. Value range:
    cache_reserve_eligibility str
    Cache retention eligibility. Used to control whether user requests bypass the cache retention node when returning to the origin. Possible values:
    check_presence_cookie str
    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_header str
    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_mode str
    Edge cache mode. Possible values:
    edge_cache_ttl str
    Edge cache expiration time in seconds.
    edge_status_code_cache_ttl str
    Status code cache expiration time in seconds.
    include_cookie str
    When generating the cache key, add the specified cookie names and their values. Multiple values are supported, separated by spaces.
    include_header str
    When generating the cache key, add the specified header names and their values. Multiple values are supported, separated by spaces.
    query_string str
    Query strings to be reserved or excluded. Multiple values are supported, separated by spaces.
    query_string_mode str
    The processing mode for query strings when generating the cache key. Possible values:
    rule str
    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_enable str
    Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
    rule_name str
    Rule name. When adding global configuration, this parameter does not need to be set.
    serve_stale str
    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:
    site_version int
    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_cache str
    Query string sorting, disabled by default. Possible values:
    user_device_type str
    When generating the cache key, add the client device type. Possible values:
    user_geo str
    When generating the cache key, add the client's geographic location. Possible values:
    user_language str
    When generating cache keys, include the client's language type. Possible values:
    siteId Number
    The site ID, which can be obtained by calling the [ListSites] API.
    additionalCacheablePorts String
    Enable caching on specified ports. Value range: 8880, 2052, 2082, 2086, 2095, 2053, 2083, 2087, 2096
    browserCacheMode String
    Browser cache mode. Possible values:
    browserCacheTtl String
    Browser cache expiration time in seconds.
    bypassCache String
    Set the bypass cache mode. Possible values:
    cacheDeceptionArmor String
    Cache deception protection. Used to defend against web cache deception attacks, only the cache content that passes the validation will be cached. Value range:
    cacheReserveEligibility String
    Cache retention eligibility. Used to control whether user requests bypass the cache retention node when returning to the origin. Possible values:
    checkPresenceCookie String
    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.
    checkPresenceHeader String
    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.
    edgeCacheMode String
    Edge cache mode. Possible values:
    edgeCacheTtl String
    Edge cache expiration time in seconds.
    edgeStatusCodeCacheTtl String
    Status code cache expiration time in seconds.
    includeCookie String
    When generating the cache key, add the specified cookie names and their values. Multiple values are supported, separated by spaces.
    includeHeader String
    When generating the cache key, add the specified header names and their values. Multiple values are supported, separated by spaces.
    queryString String
    Query strings to be reserved or excluded. Multiple values are supported, separated by spaces.
    queryStringMode String
    The processing mode for query strings when generating the cache key. Possible values:
    rule String
    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").
    ruleEnable String
    Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
    ruleName String
    Rule name. When adding global configuration, this parameter does not need to be set.
    serveStale String
    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:
    siteVersion Number
    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.
    sortQueryStringForCache String
    Query string sorting, disabled by default. Possible values:
    userDeviceType String
    When generating the cache key, add the client device type. Possible values:
    userGeo String
    When generating the cache key, add the client's geographic location. Possible values:
    userLanguage String
    When generating cache keys, include the client's language type. Possible values:

    Outputs

    All input properties are implicitly available as output properties. Additionally, the CacheRule resource produces the following output properties:

    CacheRuleId int
    Cache Rule Id.
    Id string
    The provider-assigned unique ID for this managed resource.
    CacheRuleId int
    Cache Rule Id.
    Id string
    The provider-assigned unique ID for this managed resource.
    cacheRuleId Integer
    Cache Rule Id.
    id String
    The provider-assigned unique ID for this managed resource.
    cacheRuleId number
    Cache Rule Id.
    id string
    The provider-assigned unique ID for this managed resource.
    cache_rule_id int
    Cache Rule Id.
    id str
    The provider-assigned unique ID for this managed resource.
    cacheRuleId Number
    Cache Rule Id.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing CacheRule Resource

    Get an existing CacheRule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: CacheRuleState, opts?: CustomResourceOptions): CacheRule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            additional_cacheable_ports: Optional[str] = None,
            browser_cache_mode: Optional[str] = None,
            browser_cache_ttl: Optional[str] = None,
            bypass_cache: Optional[str] = None,
            cache_deception_armor: Optional[str] = None,
            cache_reserve_eligibility: Optional[str] = None,
            cache_rule_id: Optional[int] = None,
            check_presence_cookie: Optional[str] = None,
            check_presence_header: Optional[str] = None,
            edge_cache_mode: Optional[str] = None,
            edge_cache_ttl: Optional[str] = None,
            edge_status_code_cache_ttl: Optional[str] = None,
            include_cookie: Optional[str] = None,
            include_header: Optional[str] = None,
            query_string: Optional[str] = None,
            query_string_mode: Optional[str] = None,
            rule: Optional[str] = None,
            rule_enable: Optional[str] = None,
            rule_name: Optional[str] = None,
            serve_stale: Optional[str] = None,
            site_id: Optional[int] = None,
            site_version: Optional[int] = None,
            sort_query_string_for_cache: Optional[str] = None,
            user_device_type: Optional[str] = None,
            user_geo: Optional[str] = None,
            user_language: Optional[str] = None) -> CacheRule
    func GetCacheRule(ctx *Context, name string, id IDInput, state *CacheRuleState, opts ...ResourceOption) (*CacheRule, error)
    public static CacheRule Get(string name, Input<string> id, CacheRuleState? state, CustomResourceOptions? opts = null)
    public static CacheRule get(String name, Output<String> id, CacheRuleState state, CustomResourceOptions options)
    resources:  _:    type: alicloud:esa:CacheRule    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AdditionalCacheablePorts string
    Enable caching on specified ports. Value range: 8880, 2052, 2082, 2086, 2095, 2053, 2083, 2087, 2096
    BrowserCacheMode string
    Browser cache mode. Possible values:
    BrowserCacheTtl string
    Browser cache expiration time in seconds.
    BypassCache string
    Set the bypass cache mode. Possible values:
    CacheDeceptionArmor string
    Cache deception protection. Used to defend against web cache deception attacks, only the cache content that passes the validation will be cached. Value range:
    CacheReserveEligibility string
    Cache retention eligibility. Used to control whether user requests bypass the cache retention node when returning to the origin. Possible values:
    CacheRuleId int
    Cache Rule Id.
    CheckPresenceCookie string
    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.
    CheckPresenceHeader string
    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.
    EdgeCacheMode string
    Edge cache mode. Possible values:
    EdgeCacheTtl string
    Edge cache expiration time in seconds.
    EdgeStatusCodeCacheTtl string
    Status code cache expiration time in seconds.
    IncludeCookie string
    When generating the cache key, add the specified cookie names and their values. Multiple values are supported, separated by spaces.
    IncludeHeader string
    When generating the cache key, add the specified header names and their values. Multiple values are supported, separated by spaces.
    QueryString string
    Query strings to be reserved or excluded. Multiple values are supported, separated by spaces.
    QueryStringMode string
    The processing mode for query strings when generating the cache key. Possible values:
    Rule string
    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").
    RuleEnable string
    Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
    RuleName string
    Rule name. When adding global configuration, this parameter does not need to be set.
    ServeStale string
    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:
    SiteId int
    The site ID, which can be obtained by calling the [ListSites] API.
    SiteVersion int
    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.
    SortQueryStringForCache string
    Query string sorting, disabled by default. Possible values:
    UserDeviceType string
    When generating the cache key, add the client device type. Possible values:
    UserGeo string
    When generating the cache key, add the client's geographic location. Possible values:
    UserLanguage string
    When generating cache keys, include the client's language type. Possible values:
    AdditionalCacheablePorts string
    Enable caching on specified ports. Value range: 8880, 2052, 2082, 2086, 2095, 2053, 2083, 2087, 2096
    BrowserCacheMode string
    Browser cache mode. Possible values:
    BrowserCacheTtl string
    Browser cache expiration time in seconds.
    BypassCache string
    Set the bypass cache mode. Possible values:
    CacheDeceptionArmor string
    Cache deception protection. Used to defend against web cache deception attacks, only the cache content that passes the validation will be cached. Value range:
    CacheReserveEligibility string
    Cache retention eligibility. Used to control whether user requests bypass the cache retention node when returning to the origin. Possible values:
    CacheRuleId int
    Cache Rule Id.
    CheckPresenceCookie string
    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.
    CheckPresenceHeader string
    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.
    EdgeCacheMode string
    Edge cache mode. Possible values:
    EdgeCacheTtl string
    Edge cache expiration time in seconds.
    EdgeStatusCodeCacheTtl string
    Status code cache expiration time in seconds.
    IncludeCookie string
    When generating the cache key, add the specified cookie names and their values. Multiple values are supported, separated by spaces.
    IncludeHeader string
    When generating the cache key, add the specified header names and their values. Multiple values are supported, separated by spaces.
    QueryString string
    Query strings to be reserved or excluded. Multiple values are supported, separated by spaces.
    QueryStringMode string
    The processing mode for query strings when generating the cache key. Possible values:
    Rule string
    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").
    RuleEnable string
    Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
    RuleName string
    Rule name. When adding global configuration, this parameter does not need to be set.
    ServeStale string
    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:
    SiteId int
    The site ID, which can be obtained by calling the [ListSites] API.
    SiteVersion int
    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.
    SortQueryStringForCache string
    Query string sorting, disabled by default. Possible values:
    UserDeviceType string
    When generating the cache key, add the client device type. Possible values:
    UserGeo string
    When generating the cache key, add the client's geographic location. Possible values:
    UserLanguage string
    When generating cache keys, include the client's language type. Possible values:
    additionalCacheablePorts String
    Enable caching on specified ports. Value range: 8880, 2052, 2082, 2086, 2095, 2053, 2083, 2087, 2096
    browserCacheMode String
    Browser cache mode. Possible values:
    browserCacheTtl String
    Browser cache expiration time in seconds.
    bypassCache String
    Set the bypass cache mode. Possible values:
    cacheDeceptionArmor String
    Cache deception protection. Used to defend against web cache deception attacks, only the cache content that passes the validation will be cached. Value range:
    cacheReserveEligibility String
    Cache retention eligibility. Used to control whether user requests bypass the cache retention node when returning to the origin. Possible values:
    cacheRuleId Integer
    Cache Rule Id.
    checkPresenceCookie String
    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.
    checkPresenceHeader String
    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.
    edgeCacheMode String
    Edge cache mode. Possible values:
    edgeCacheTtl String
    Edge cache expiration time in seconds.
    edgeStatusCodeCacheTtl String
    Status code cache expiration time in seconds.
    includeCookie String
    When generating the cache key, add the specified cookie names and their values. Multiple values are supported, separated by spaces.
    includeHeader String
    When generating the cache key, add the specified header names and their values. Multiple values are supported, separated by spaces.
    queryString String
    Query strings to be reserved or excluded. Multiple values are supported, separated by spaces.
    queryStringMode String
    The processing mode for query strings when generating the cache key. Possible values:
    rule String
    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").
    ruleEnable String
    Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
    ruleName String
    Rule name. When adding global configuration, this parameter does not need to be set.
    serveStale String
    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:
    siteId Integer
    The site ID, which can be obtained by calling the [ListSites] API.
    siteVersion Integer
    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.
    sortQueryStringForCache String
    Query string sorting, disabled by default. Possible values:
    userDeviceType String
    When generating the cache key, add the client device type. Possible values:
    userGeo String
    When generating the cache key, add the client's geographic location. Possible values:
    userLanguage String
    When generating cache keys, include the client's language type. Possible values:
    additionalCacheablePorts string
    Enable caching on specified ports. Value range: 8880, 2052, 2082, 2086, 2095, 2053, 2083, 2087, 2096
    browserCacheMode string
    Browser cache mode. Possible values:
    browserCacheTtl string
    Browser cache expiration time in seconds.
    bypassCache string
    Set the bypass cache mode. Possible values:
    cacheDeceptionArmor string
    Cache deception protection. Used to defend against web cache deception attacks, only the cache content that passes the validation will be cached. Value range:
    cacheReserveEligibility string
    Cache retention eligibility. Used to control whether user requests bypass the cache retention node when returning to the origin. Possible values:
    cacheRuleId number
    Cache Rule Id.
    checkPresenceCookie string
    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.
    checkPresenceHeader string
    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.
    edgeCacheMode string
    Edge cache mode. Possible values:
    edgeCacheTtl string
    Edge cache expiration time in seconds.
    edgeStatusCodeCacheTtl string
    Status code cache expiration time in seconds.
    includeCookie string
    When generating the cache key, add the specified cookie names and their values. Multiple values are supported, separated by spaces.
    includeHeader string
    When generating the cache key, add the specified header names and their values. Multiple values are supported, separated by spaces.
    queryString string
    Query strings to be reserved or excluded. Multiple values are supported, separated by spaces.
    queryStringMode string
    The processing mode for query strings when generating the cache key. Possible values:
    rule string
    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").
    ruleEnable string
    Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
    ruleName string
    Rule name. When adding global configuration, this parameter does not need to be set.
    serveStale string
    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:
    siteId number
    The site ID, which can be obtained by calling the [ListSites] API.
    siteVersion number
    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.
    sortQueryStringForCache string
    Query string sorting, disabled by default. Possible values:
    userDeviceType string
    When generating the cache key, add the client device type. Possible values:
    userGeo string
    When generating the cache key, add the client's geographic location. Possible values:
    userLanguage string
    When generating cache keys, include the client's language type. Possible values:
    additional_cacheable_ports str
    Enable caching on specified ports. Value range: 8880, 2052, 2082, 2086, 2095, 2053, 2083, 2087, 2096
    browser_cache_mode str
    Browser cache mode. Possible values:
    browser_cache_ttl str
    Browser cache expiration time in seconds.
    bypass_cache str
    Set the bypass cache mode. Possible values:
    cache_deception_armor str
    Cache deception protection. Used to defend against web cache deception attacks, only the cache content that passes the validation will be cached. Value range:
    cache_reserve_eligibility str
    Cache retention eligibility. Used to control whether user requests bypass the cache retention node when returning to the origin. Possible values:
    cache_rule_id int
    Cache Rule Id.
    check_presence_cookie str
    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_header str
    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_mode str
    Edge cache mode. Possible values:
    edge_cache_ttl str
    Edge cache expiration time in seconds.
    edge_status_code_cache_ttl str
    Status code cache expiration time in seconds.
    include_cookie str
    When generating the cache key, add the specified cookie names and their values. Multiple values are supported, separated by spaces.
    include_header str
    When generating the cache key, add the specified header names and their values. Multiple values are supported, separated by spaces.
    query_string str
    Query strings to be reserved or excluded. Multiple values are supported, separated by spaces.
    query_string_mode str
    The processing mode for query strings when generating the cache key. Possible values:
    rule str
    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_enable str
    Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
    rule_name str
    Rule name. When adding global configuration, this parameter does not need to be set.
    serve_stale str
    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:
    site_id int
    The site ID, which can be obtained by calling the [ListSites] API.
    site_version int
    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_cache str
    Query string sorting, disabled by default. Possible values:
    user_device_type str
    When generating the cache key, add the client device type. Possible values:
    user_geo str
    When generating the cache key, add the client's geographic location. Possible values:
    user_language str
    When generating cache keys, include the client's language type. Possible values:
    additionalCacheablePorts String
    Enable caching on specified ports. Value range: 8880, 2052, 2082, 2086, 2095, 2053, 2083, 2087, 2096
    browserCacheMode String
    Browser cache mode. Possible values:
    browserCacheTtl String
    Browser cache expiration time in seconds.
    bypassCache String
    Set the bypass cache mode. Possible values:
    cacheDeceptionArmor String
    Cache deception protection. Used to defend against web cache deception attacks, only the cache content that passes the validation will be cached. Value range:
    cacheReserveEligibility String
    Cache retention eligibility. Used to control whether user requests bypass the cache retention node when returning to the origin. Possible values:
    cacheRuleId Number
    Cache Rule Id.
    checkPresenceCookie String
    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.
    checkPresenceHeader String
    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.
    edgeCacheMode String
    Edge cache mode. Possible values:
    edgeCacheTtl String
    Edge cache expiration time in seconds.
    edgeStatusCodeCacheTtl String
    Status code cache expiration time in seconds.
    includeCookie String
    When generating the cache key, add the specified cookie names and their values. Multiple values are supported, separated by spaces.
    includeHeader String
    When generating the cache key, add the specified header names and their values. Multiple values are supported, separated by spaces.
    queryString String
    Query strings to be reserved or excluded. Multiple values are supported, separated by spaces.
    queryStringMode String
    The processing mode for query strings when generating the cache key. Possible values:
    rule String
    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").
    ruleEnable String
    Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
    ruleName String
    Rule name. When adding global configuration, this parameter does not need to be set.
    serveStale String
    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:
    siteId Number
    The site ID, which can be obtained by calling the [ListSites] API.
    siteVersion Number
    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.
    sortQueryStringForCache String
    Query string sorting, disabled by default. Possible values:
    userDeviceType String
    When generating the cache key, add the client device type. Possible values:
    userGeo String
    When generating the cache key, add the client's geographic location. Possible values:
    userLanguage String
    When generating cache keys, include the client's language type. Possible values:

    Import

    ESA Cache Rule can be imported using the id, e.g.

    $ pulumi import alicloud:esa/cacheRule:CacheRule example <site_id>:<cache_rule_id>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi