-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
I have worked with about a dozen of different caches, but with the documentation at hand, I can't figure out even the most basic task, storing and retrieving data with a simple key. Hypothetical, to give you an idea:
import Cache from 'ladda-cache';
import sleep from 'es7-sleep';
const c = new Cache;
c.set({
key: 'KEY',
value: 'VALUE',
expires: Date.now() + 2000
});
console.log(c.get({key: 'KEY'})); // 'VALUE'
await sleep(2000);
console.log(c.get({key: 'KEY'})); // nullWhat does the real code need to look like?
Further questions, didn't find anything useful when grepping for keywords:
- How do you replace data for a valid key in an atomic fashion?
- What are the means in ladda to avoid stampedes?
- How do you partition the cache with namespaces or similar so that keys don't trample over each other accidentally?
connor-baer
Metadata
Metadata
Assignees
Labels
No labels