Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caching With TTL #461

Open
hinawatts opened this issue Dec 17, 2020 · 1 comment
Open

Caching With TTL #461

hinawatts opened this issue Dec 17, 2020 · 1 comment

Comments

@hinawatts
Copy link

Hi,

I am trying to use caffeine cache implementation, where I have a requirement to cache authentication token for TTL based on it's expiration value. I was trying to use cachingWithTTL method, but I see it's no longer there. Can someone point me how can I implement this requirement? Any examples would help.

@lewisjkl
Copy link
Collaborator

I believe you are looking for the method:

  def put(keyParts: Any*)(value: V, ttl: Option[Duration])

where you can pass an optional ttl as the third parameter.

There is an example using memcached here in the docs, but the api for caffeine should look the same.

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

No branches or pull requests

2 participants