cache_​id

Version: v2024-01-09Includes use: Yes

Behavior name: Cache ID Modification

Controls which query parameters, headers, and cookies are included in or excluded from the cache key identifier.

Note: Applying a set of cache_id behaviors within the same rule results in a system of forming cache keys that applies independently to the rule's content.

If any cache_id behaviors are present in a rule, any others specified in parent rules or prior executing sibling rules no longer apply. Otherwise for any rule that lacks a cache_id behavior, the set of behaviors specified in an ancestor or prior sibling rule determines how to form cache keys for that content.

Default behavior

These samples reflect the behavior's default settings. You can use these as is in your configurations or make adjustments based on the behavior's available options.

data "akamai_property_rules_builder" "cache_id" {
  rules_v2024_01_09 {
    name     = "Cache ID Modification"
    comments = "Controls which query parameters, headers, and cookies are included in or excluded from the cache key identifier."
    behavior {
      cache_id {
        elements = []
        optional = true
        include_value = true
        rule = "INCLUDE_QUERY_PARAMS"
      }
    }
  }
}
"behaviors": [
  {
    "name": "cacheId",
    "options": {
      "elements": [],
      "optional": true,
      "includeValue": true,
      "rule": "INCLUDE_QUERY_PARAMS"
    }
  }
]

Options

Option Description
rule
Specifies how to modify the cache ID. Value is one of:
  • INCLUDE_QUERY_PARAMS
  • INCLUDE_COOKIES
  • INCLUDE_HEADERS
  • EXCLUDE_QUERY_PARAMS
  • INCLUDE_ALL_QUERY_PARAMS
  • INCLUDE_VARIABLE
  • INCLUDE_URL
include_value
Includes the value of the specified elements in the cache ID. Otherwise only their names are included.
optional
Requires the behavior's specified elements to be present for content to cache. When disabled, requests that lack the specified elements are still cached.
elements
Specifies the names of the query parameters, cookies, or headers to include or exclude from the cache ID.
variable_name
Specifies the name of the variable you want to include in the cache key.