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

Strict cache expiration #108

Open
CMCDragonkai opened this issue Oct 19, 2013 · 3 comments
Open

Strict cache expiration #108

CMCDragonkai opened this issue Oct 19, 2013 · 3 comments

Comments

@CMCDragonkai
Copy link
Contributor

I am trying to cache an item with strict expiration. By this I mean that if I read and update an item the cache doesnt get a new expiration. Currently if I set an item that already exists I need to set a new expiration. However I want the item to continue with the same expiration. This is useful for caching OAuth access tokens.

This could be done in several ways. One could to allow the end developer to access the remaining expiration and exact expiration date so they can reset with a new remaining expiration time. But you can also add new methods to the item to facilitate this.

One thing though is that inserting an item with 0 as expiration. How would that work?

@tedivm
Copy link
Member

tedivm commented Apr 24, 2014

I've merged in a PR that should give you access to both the expiration and the creation time of the item. Does that help?

@CMCDragonkai
Copy link
Contributor Author

Which PR was that?

@CMCDragonkai
Copy link
Contributor Author

A more elegant manner would be a setting method that keeps the old expiration. Less work for everybody!

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