Cache ID Modification

This behavior controls which query parameters, headers, and cookies form the cache key identifier.

πŸ“˜

The Cache ID Modification behavior overrides how nesting usually works within rules. When a rule contains this behavior, any other instances of the behavior specified in a parent rule or prior executing sibling rules no longer apply. When a rule has no Cache ID Modification behavior, the set of behaviors specified in a parent or prior sibling rule determines how to form cache keys for that content.

How it works

Cache ID Modification takes the cache control options beyond regular path, filename, and query parameters. With this behavior enabled, you can add any specific header or cookie values to the cache key. For example, you can use the Accept-Language header to cache different versions of a single URL that's been localized.

Features and options

FieldWhat it doesSub-options
ActionSpecifies how to modify the cache ID.
  • Include the following headers. Includes the specified HTTP headers in the cache ID.
  • Include the following cookies. Includes the specified cookies in the cache ID.
  • Include all query parameters. Includes all query parameters when forming a cache ID.
  • Include the following query parameters. Includes the specified set of query parameters when forming a cache ID.
  • Exclude the following query parameters. Excludes the specified set of query parameters when forming a cache ID.
  • Include a user-defined variable. Includes a specific user-defined Variable in the cache ID.
  • Include the URL. Includes the full URL.

Include ValuesWith Action set to one of the following:

  • Include the following cookies
  • Include the following query parameters
  • Include the following headers

Select whether to include the value of the elements added to the cache ID. If set to No, only the name is added.
  • Yes
  • No
Require Included ElementsWith Action set to one of the following:

  • Include the following cookies
  • Include the following query parameters
  • Include the following headers
  • Exclude the following query parameters

Select whether included elements are required in order to cache content. When required, if a request lacks the included elements, the content is not cached. When not required, lack of included elements does not prevent caching.
  • Required for caching
  • Not required for caching
Elements to includeWith Action set to one of the following:

  • Include the following cookies
  • Include the following query parameters
  • Include the following headers
  • Exclude the following query parameters

Specifies the names of the query parameters, cookies, or headers to include or exclude from the cache ID.
VariableWith Action set to:

  • Include a user-defined variable

Select the variable you want to include in the cache key.

Tips and best practices

You can apply several instances of this behavior to a rule to cache various inputs. For example, if you want to include both headers and cookies in the cache ID, you need to add two instances of this behavior, one for each type of input.