Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

About the cache time for each credentials #458

Closed
wd opened this issue Jan 6, 2021 · 1 comment
Closed

About the cache time for each credentials #458

wd opened this issue Jan 6, 2021 · 1 comment

Comments

@wd
Copy link

wd commented Jan 6, 2021

According to the code here

c.cache.Set(identity.String(), f, c.cacheTTL)

The cache time will be set to sessionDuration - sessionRefresh , codes here

cacheTTL: sessionDuration - sessionRefresh,

But when Kiam request a new credential, it will issue the request with the time sessionDuration

SessionDuration: c.sessionDuration,

In our environments, the sessionDuration is 15m, and the sessionRefresh is 5m. So If I understand correctly, the cache will expire after 10m. And after 10m, when an agent requests the credentials, the server will send an issue request to AWS synchronously, even the previous session is still valid?

If so, I think it's should be better if set the cacheTTL to sessionDuration. When an agent request credential , the server can return the cached value first, and send an issue request asynchronously to refresh it when the cache TTL is less than sessionRefresh?

@wd
Copy link
Author

wd commented Jan 8, 2021

Oh, I missed the DefaultPurgeInterval setting when creating the cache.

@wd wd closed this as completed Jan 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant