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
Field | What it does | Sub-options |
---|---|---|
Action | Specifies how to modify the cache ID. |
|
Include Values | With Action set to one of the following:
Select whether to include the value of the elements added to the cache ID. If set to No, only the name is added. |
|
Require Included Elements | With Action set to one of the following:
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. |
|
Elements to include | With Action set to one of the following:
Specifies the names of the query parameters, cookies, or headers to include or exclude from the cache ID. | |
Variable | With Action set to:
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.
Updated over 1 year ago