brianleroux/lawnchair — Issue #90: TTL
Author: stephenhandley
Created: 2012-03-01 05:58:05+00:00
State: open

I'm using Lawnchair primarily as a local caching solution in a PhoneGap app and haven't been able to find anything in the source for a way to specify a time-to-live when saving.

Currently, I'm just using an adapter around lawnchair that supports conditionally invalidating records based on timestamp in a wrapper, and returns null if the data is expired, but I'm wondering whether there's any (plans for) api support for things along those lines. There's several mentions of:
''''
// TODO move timestamp to a plugin
''''
so wasn't sure if tll support for cache is in the works for a future plugin?

seems like it would make sense to have an optional time to live argument passed in an options array while setting data... it's likely the canonical datastore is gonna be sitting on a server somewhere and it appears that approach would be backwards compatible with the current api (doesn't look like save currently overloads the second argument as an object, just as a string and function)