Skip to content

Commit 4fd182f

Browse files
authored
feat: hydra JWK caching (ory#2299)
1 parent 6759e7e commit 4fd182f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/hydra/jwks.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,16 @@ ory patch oauth2-config --project <project-id> --workspace <workspace-id> \
113113
```
114114

115115
For more information on how to create a custom keyset, see the [ory create jwk](../cli/ory-create-jwk.md) command.
116+
117+
## Caching of JWKs
118+
119+
The Ory Hydra Enterprise License (OEL) supports in-memory caching of JWKs to improve performance and reduce latency. It is
120+
configurable via the following options:
121+
122+
- `db.jwk_cache.enabled` governs whether the cache is enabled or not
123+
- `db.jwk_cache.size` is the maximum number of keys to be cached
124+
- `db.jwk_cache.ttl` is the time-to-live for cached keys
125+
126+
It's recommended to set a cache TTL to force regular refreshes of the keys. Updates to keys aren't propagated to the cache, so
127+
it's possible for tokens to be signed with rotated keys for the cache TTL duration. Clients are expected to accept old keys for a
128+
certain period of time.

0 commit comments

Comments
 (0)