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

Item TTL left? #1

Open
pquerner opened this issue Aug 1, 2022 · 1 comment
Open

Item TTL left? #1

pquerner opened this issue Aug 1, 2022 · 1 comment

Comments

@pquerner
Copy link

pquerner commented Aug 1, 2022

Hey,

is it possible to ask the library how long an item is left "stored" (ie. get its time left in the cache)?

Thanks!

@pksilen
Copy link
Owner

pksilen commented Aug 30, 2022

Hi,
I created a new version of the library, version 1.2.0.
This new version contains a new method: getItemExpirationTimestampInMillisSinceEpoch

You can use it to get the expiration timestamp for a cache item.
If you want know how long item will stay in cache, you can subtract Date.now() value from the value returned by
getItemExpirationTimestampInMillisSinceEpoch(...) method.

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