Skip to content

feat: add lru cache for jwks and tenants#915

Open
ferhatelmas wants to merge 1 commit intomasterfrom
ferhat/cache
Open

feat: add lru cache for jwks and tenants#915
ferhatelmas wants to merge 1 commit intomasterfrom
ferhat/cache

Conversation

@ferhatelmas
Copy link
Member

What kind of change does this PR introduce?

Feature

What is the current behavior?

Tenant JWK and tenant config caches are bare maps so they can grow unbounded.

What is the new behavior?

Add a cache wrapper that emits hit metrics, which is a LRU cache under the hood.
Use it for tenant JWKs and configs, and convert existing JWT and S3 creds caches to use this new cache.

Additional context

To keep purge overhead predictable, each cache registers a periodic stale cleanup and also forces cleanup before metric reporting for accuracy.

also add metrics for the cache and use it
for jwts and s3 credentials

add a few panels to show new metrics

Signed-off-by: ferhat elmas <elmas.ferhat@gmail.com>
@ferhatelmas ferhatelmas requested a review from a team as a code owner March 17, 2026 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant