You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implemented this myself using https://github.com/erni27/imcache but would love to have it integrated into the interceptor so I can just pass a TTL to it and forget about it.
Implemented this myself using https://github.com/erni27/imcache but would love to have it integrated into the interceptor so I can just pass a TTL to it and forget about it.
I'm not sure if it's a good cache, the best cache for the job or anything - I didn't need gc-lite caches relying on sharded pointer slices and other magic, I'm storing hundreds of introspection sessions at most ever, primarily used when the same access token makes a flurry of frontend async PromiseAll style batch calls.
This cache allowed me to set a default TTL, a goroutine to clean up old entries in the background, a maximum cache key size to prevent OOM - happy enough with it!
It's been good with a TTL of 60s, so the first call incurs a 100ms latency hit (as my introspection calls mostly do) and the subsequent calls for 60s are only incurring 1ms penalty to return the introspection response from the cache (over gRPC via istio/envoy).
We should provide the ability to configure a cache in the introspection interceptor so that not every call is sent to the endpoint.
The cache can either be implemented by the interceptor itself or at least be provided by the implementation using this library.
The text was updated successfully, but these errors were encountered: