Skip to content

Commit

Permalink
add more info about cache key generation in proxy-cache-advanced (#6982)
Browse files Browse the repository at this point in the history
* add more info about cache key generation in proxy-cache-advanced

* add links to the params

---------

Co-authored-by: lena-larionova <[email protected]>
  • Loading branch information
gforns and lena-larionova committed Feb 21, 2024
1 parent 2ad1039 commit 7a3761e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/_hub/kong-inc/proxy-cache-advanced/overview/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@ Currently the cache key format is hard-coded and cannot be adjusted. Internally,
represented as a hexadecimal-encoded MD5 sum of the concatenation of the constituent parts calculated as follows:

```
key = md5(UUID | method | request)
key = md5(UUID | method | request | query_params | headers | consumer_groups)
```

Where `method` is defined via the OpenResty `ngx.req.get_method()` call, and `request` is defined via the Nginx `$request` variable.
Where `method` is defined via the OpenResty `ngx.req.get_method()` call, `request` is defined via the Nginx `$request` variable.
You can control `query_params` and `headers` via the configuration parameters
[`vary_query_params`](/hub/kong-inc/proxy-cache-advanced/configuration/#config-vary_query_params) and
[`vary_headers`](/hub/kong-inc/proxy-cache-advanced/configuration/#config-vary_headers).

Kong will return the cache key associated with a given request as the `X-Cache-Key` response header.
It is also possible to precalculate the cache key for a given request as noted above.

Expand Down

0 comments on commit 7a3761e

Please sign in to comment.