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'})); // null
What 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?
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:
What does the real code need to look like?
Further questions, didn't find anything useful when grepping for keywords: