Cache key query parameters

A cache key is an index entry that uniquely identifies an object in a cache. You can customize cache keys by specifying whether to use a query string (or portions of it) in an incoming request to differentiate objects in a cache.

Note: This section explains the concept of cache key query parameters. For specific steps to configure cache keys in API Gateway, see Configure cache key query parameters.

By default, edge servers cache content based on the entire resource path and a query string. You can modify this default behavior by specifying that cache keys should not include a query string or a portion of it. This is especially useful for requests that include a query string that has no relation to the uniqueness of API content. For example, to track clients’ interaction with an API, a unique session ID might be a part of a query string. This session ID might not affect the API content served to clients.

Note: The question mark symbol always precedes a query string. In the following path, session_id=12345 is a query string that represents a session ID: http://myhostname.akamai.com/userdata?session_id=12345.

You can customize cache keys in one of the following ways:

Include all parameters (preserve order from request)
Include in cache keys all query parameters from the request.
Include all parameters (reorder alphabetically)
Include in cache keys all query parameters from the request, but reorder them alphabetically.
Exclude all parameters
Exclude from cache keys all query parameters in a request.
Include only specified parameters
Include in cache keys only specific parameters that you define. You can either enforce an exact match of these parameters, or match the parameters that just begin with the strings you defined.
Exclude only specified parameters
Exclude from cache keys only specific parameters that you define. You can either enforce an exact match of these parameters, or match the parameters that just begin with the strings you defined.