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

Plans to add TTL or other expiration concept? #7

Closed
uberspeck opened this issue Jan 6, 2015 · 5 comments
Closed

Plans to add TTL or other expiration concept? #7

uberspeck opened this issue Jan 6, 2015 · 5 comments

Comments

@uberspeck
Copy link

Are there any plans to add TTL features? jStorage, for example, has a TTL feature that's pretty useful. I'd make a pull request but, to be honest, not too confident in my ability to implement it cleanly

@tymondesigns
Copy link
Owner

Hmm.. Not sure about that one. My concern is that I don't want the library to do too much, and become bloated with features that would rarely be useful.

Can you provide a scenario where you think this would be useful?

@uberspeck
Copy link
Author

In my case I'm using local storage as a cache to reduce server requests. however I want the cached data to "expire" after a set time to prevent old data from hanging around. i can do this externally to angular-locker, but it would be awesome to just pass a TTL when setting data

*** EDIT ***

Just to give you an idea, here's the jStorage implementation - https://github.com/andris9/jStorage/blob/master/jstorage.js#L490

@tymondesigns
Copy link
Owner

OK I see what you mean. I will have a think as to how I would implement it, and probably throw together a quick prototype and see where I get.

Thanks!

@uberspeck
Copy link
Author

awesome! Thanks for looking into it!

@tymondesigns
Copy link
Owner

decided not to add this for now.. might look at it again at some point

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants